I. Some of the modifiers provided in Java that can modify classes, variables, and methods, which are common in Java: abstract (abstract), static (static), public (common), protected (protected), Private ( private), synchronized (synchronous), native (local), transient (temporary), volatile (volatile), final (immutable)
Two. modifier top-level class modifiers include abstract, public, and final, while static, protected, and private cannot modify the top-level class. Member methods and member variables can have several modifiers, while local variables are only final decorated
Three. Accessibility to 4 levels of access
Note: Top-level classes can only be decorated by default modifiers and public, and cannot be modified by private and protected
Four. The abstract modifier can be used to modify class and Member methods
1. A class that is abstract decorated is an abstraction class, and an abstract class cannot be instantiated
2. An abstract method is represented by an abstraction method, which has no method body: "{}", which is used for subclasses to override
3.abstract decorated classes, that is, abstract classes can have common methods and abstract methods
4. Abstract classes and abstract methods cannot be decorated with the final modifier. The abstract modifier and the final modifier cannot be used
Five. Final modifier
1.final is the meaning of "immutable", which can be decorated with non-abstract, non-abstract member methods, and variables
2. Classes with final modifications cannot be inherited, no subclasses
3. The final modified method cannot be overridden by a quilt class
4. The final modified variable represents a constant, such as (PI), so it can only be assigned once and cannot be changed
Six. Static modifier
1. member variables decorated with static represent static variables that can be accessed directly through the class name
2. The member method, which is decorated with static, represents a static method that can be accessed directly through the class name
3. Code blocks with static modifications, when the full name of the Java Virtual Machine (JVM) is: Java machine can navigate to them based on the class name in the method of the Run-time data area, and can only run once
The above is a small set to introduce the Java language in those modifiers, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!