-
Private: Indicates that members are private and can only be accessed in the current class.
-
Default: no modifiers (default), access within the same package, the access is package-level access.
-
Protected: Represents protected privileges, embodied in inheritance, which means that subclasses can access protected members of their parent class and other classes within the same package can access protected members.
-
Public: Indicates that the member is public and accessible to all other classes.
-
Final: The keyword means final and can modify member methods, member variables, and classes
-
Modifier method: Indicates that the method is final and cannot be overridden.
-
Modifier variable: Indicates that the variable is constant and cannot be assigned again.
-
Modifier class: Indicates that the class is final and cannot be inherited.
-
Variables are primitive types: The final modifier means that the data value of the primitive type cannot be changed.
-
Variables are reference types: the final modifier means that the address value of a reference type cannot be changed, but the contents of the address can be.
-
-
Static: The keyword is static, can modify member methods, member variables
-
Non-static member methods
-
Access to static member variables
-
Access to non-static members
-
Access to static member methods
-
Access to non-static member methods
-
-
Static member methods
-
Access to static member variables
-
Access to static member methods
-
-
Summary: Static member methods can only access static members
-