1 命名
- 类名:一个或多个有意义的单词连缀而成,每个单词首字母大写,其余字母小写;
- field/方法名:一个或多个有意义的单词连缀而成,第一个单词首字母小写,后面单词首字母大写,其余字母小写;
2 关键字
- static : 修饰方法 field
- this : 构造器中引用该构造器正在初始化的对象;在方法中引用调用该方法的对象;调用同一个类中重载的构造器
- super:调用父类被覆盖的方法和变量;调用父类的构造器
- instanceof:判断对象是否是类、子类或实现类的实例
3 面向对象的特性:封装、继承、多态
4 类的成员:构造器、Field、方法、初始化块
5 静态初始化块比普通初始化块先执行,普通初始化