

然后进行调用.此时由于在Person类的set方法已经设置好数据的判断所以不会出现年龄为负的情况

然后来定义一个学生类作为案例:

然后来使用类创建对象并调用

然后进行调用.此时由于在Person类的set方法已经设置好数据的判断所以不会出现年龄为负的情况
然后来定义一个学生类作为案例:
然后来使用类创建对象并调用
本文标题:24 Chapter 面向对象关键字private的使用 202
本文链接:https://www.haomeiwen.com/subject/ovydzctx.html
网友评论