1.27 Java Basics Summary ① access modifier access rights ② classes and methods basic declaration and use
Member variables (properties)
Adding member variables to the ① class
Access modifier type variable name private String name
② instantiating an Object
Call the constructor method class of the class to construct the object, Teacher one = new Teacher ();
Static can be called directly, because static is class-level
General rules of ③javabean inside
There should be public non-parametric constructs
There should be a Get/set method that conforms to the naming convention
Collection of ④ objects:
When no reference is directed to the object, the GC recycles
Active Recycle: object = null;
Access rights for ⑤ access modifiers
publicprotected Default Private
Similar √√√√
Same package √√√
Different buns category √√
Different packages not subclasses Yes
1.27 Java Basics Summary ① access modifier access rights ② classes and methods basic declaration and use 1.27 Java Basics summary ① access modifier Access ② classes and methods basic declaration and use