The concept and function of package
Concept:
----is physically a folder
----Logically a collection of logically related classes
Role:
----Avoid class names
----Controlling access rights
Naming conventions:
-----First level refers to the type of the project, such as com,org,gov, etc.
------The second level refers to the company name that the project develops or runs, such as: Chinasofti,icss,huawei, etc.
-----The third level refers to the name of the project, such as: COREJAVA,BCMS,OA,ERP, etc.
-----Fourth level refers to the name of the project module, such as: Bean,action,exception,chapter01, etc.
Permission access modifiers
1) Public: Modify the class, properties, methods, and so on. can be accessed by any class
2) Protected: The protected permission modifier property, method. (can be accessed by the same package class, if it is not the same package class, it must be a subclass of the class to access)
3) Default: The same package permission modifier class, properties, methods. can only be accessed by the same package class
4) Private: Private permission Modifier property, method. can only be accessed in this class
Encapsulation in the Java class
Encapsulation:
All the properties of-----object are combined with all methods to form an indivisible independent unit
-----Hide the internal structure of the object as much as possible
Specific performance:
----Property using private permissions
----method to use public permissions
java-access modifiers and packages