Class, method, member variable, and local variable modifier class member access construction method member variable abstract (abstract) √ --- static (static) -√-public (public) √-protected (protected) √-private (private)-√-synchronized (synchronous) -√ --- native (local)-√ --- transient (temporary) --- √-volatie (easy to lose) --- √-final (do not change) √-√ class modifier Public can be accessed from other classes Abstract this class cannot be instantiated Final can no longer declare subclass constructor modifier Public can be accessed from all classes Protected can only accessing Private from the class of the same package and its subclass can only access the domain/member variable modifier Public in this class, and can access Protected from all classes only from the class of the same package and in its subclass, accessing Private can only access its Sta from this class. Tic can only have one domain value for all instances of this class. transient is not a part of the persistent state of an object. Volatile can be modified by asynchronous threads. final must be assigned with the initial value and cannot be modified locally. the variable modifier final must assign the initial value to it and cannot modify its method modifier Public. It can be accessed from all classes. Protected can only access it from the class of the same package and its subclass. there is no method body for accessing it in this class, the final subclass of an abstract class cannot overwrite it. static is bound to the class itself rather than the instance of the class. native. This method is implemented by other programming languages. asnchronized must be decorated first before a thread calls it. integration 1. class modifier: Public: it can be used in any other class. By default, it is any class under the unified package. Abstract: Abstract class, which cannot be instantiated and can contain Abstract methods. Abstract methods are not implemented, have no specific functions, and can only be derived from subclasses. Final: cannot be inherited. 2. Variable modifier: the declaration of a class member variable must be in the class body, rather than in the method. The declaration of a method is a local variable. 1. accessable modifier: 2. static: Class variable: The variable owned by a class, not the variable of every instance of the class. A class variable is a class variable that no matter how many objects are created in the class, the system only allocates memory for the class variables when calling the class for the first time. All objects share the class variables, therefore, you can use the class itself or an object to define class variables. 3. final: constant. 4. volatile: declare a variable that may be controlled and modified by several threads that run simultaneously. Instance variable: corresponds to the class variable, that is, each object has its own independent instance variable. III. method: (the variable object is divided into the instance method and class method, and there is no static modification difference) Class Method: Use the static keyword to describe method 1. the first class that calls a class method is that the system only creates a version for the class, which is shared by the class and all instances of the class. 2. Class methods can only operate class variables and cannot access instance variables. Class methods can be called in the class without creating an instance. Of course, they can also be called through objects. Instance method: the instance method can operate on the instance variables of the current object, and can also operate class variables. The method can be overloaded. The requirement is that the method name is the same, but the parameters must be different. (Different parameters can make different types, different orders, and different numbers) return type of the method: If there is no return type, it is declared as void. scope of variables in the Method: 1. member variable: entire class. 2. Local variables: defined until the end of the method block. 3. method parameters: the entire method or constructor. 4. Exception Handling parameters: the parameters are passed to the exception handling method. Constructor: A method with the same name as a class. After opening up the memory space for the new object, it is used to initialize the new object. You cannot explicitly call an object. Static initiators: Format: static {<value assignment statement group>} differences between static initiators and constructor: static initializes static fields of the class. After the initialization class of the newly created object enters the memory, the system automatically executes Special statements (only once) after the system calls and executes the new statement) modifier of special method: abstract method: it is modified with abstract. Only the declared part is used, and the method body is empty, which is completed in the subclass. Class Method: static method, modified with static, 1. when calling, use the class name as the prefix, rather than the name of an instance object of the Class 2. it cannot be owned by a single object and belongs to the whole class. 3. member variables cannot be processed. Final method: the final modification method cannot be redefined by the quilt class. Local method: the native modification method represents special methods written in other languages, including C, C ++, FORTRAN, and assembly language. 4. access controllers of Class Members: access controllers of class methods and member variables. A class is invisible as a whole object, it does not mean that all his domains and methods are invisible to other parts of the program, and they need to be judged by their access modifiers. The permission is as follows: the access modifier has different packages in the same class and different sub-classes, and non-subclass private √ protected √ public √ default √