java面向对象
摘要:面向对象的三大特征:封装、继承、多态 封装定义:隐藏类的内部信息,不允许外部程序直接访问,而是通过方法进行操作 封装的三大步骤: class Student { //属性 //第一步:将属性设置为私有的private,只能在本类中使用 private int age; //第二步:编写对应属性的赋值
阅读全文
posted @ 2020-06-30 10:28
posted @ 2020-06-30 10:28
posted @ 2020-06-28 17:36
posted @ 2020-06-28 17:18
posted @ 2020-06-28 16:42
posted @ 2020-06-28 16:18
posted @ 2020-06-15 17:33