摘要: 静态变量(static)与非静态变量,静态方法(static)与非静态方法 //static public class Student { private static int age; //静态的变量(静态属性) private double score; //非静态的变量 public void 阅读全文
posted @ 2021-11-16 22:48 wydilearn 阅读(47) 评论(0) 推荐(0)
摘要: 封装 程序设计要高内聚,低耦合 封装(数据的隐藏) 通常应禁止直接访问一个对象中数据的实际表示,而应该通过操作接口来访问,这称为信息隐藏 属性私有,get/set public static void main(String[] args) { Student s1 = new Student(); 阅读全文
posted @ 2021-11-16 21:38 wydilearn 阅读(115) 评论(0) 推荐(0)