Permission control is particularly important. the variables that can be directly called by the outside and methods that cannot be called directly are implemented through permission control.
Java permission control includes public, protected, and private, and a package access permission. For details, see the following description.
1. refactoring means rewriting the Code to make it more readable, easier to understand, or more efficient.
2. Java access permission levels. The maximum and minimum permissions are public, protected, package access permission (no keyword), and private.
3. A variant unit (a Java file) can contain multiple classes, but only one class is public. Otherwise, errors will occur during compilation. When a Java file is compiled, each class in the Java file has an output file, which is the same as the corresponding class name in the Java file. Therefore, multiple class files may be generated after a Java file is compiled.
4. The class library is actually a group of class files. Each file must have a public class that can have multiple non-public classes.
5. All naming rules for Java packages Use lowercase letters, including intermediate characters. Generally, the private domain name in the opposite direction is used as the package name. For example, Com. Google.
6. The public, protected, and private permission keywords are used before the definition of each member in the class, whether it is a variable or a method. However, the local variables in the method do not need to be modified using these permission modifiers.
7. Private means that no other class can access this member except the class containing this member. Other classes in the same package cannot directly access private members.
8. variables or Methods Modified by protected can be accessed only in this class or subclass. Other classes that do not include this class or do not have subclass classes.
9. The public modifier is visible to everyone.
10. access permission control is often called the hiding of specific implementations, packaging data and methods into classes, and hiding specific implementations. These are collectively called encapsulation.