1. Modifier A in Java. Permission modifiers
Private, default, Protected,public
B. Status modifier
Static,final
C. Abstract modifiers
Abstract
2. Class modifiers
Public (access control), declare a class as a common class, he can be accessed by any object, the main class of a program must be a public class, and a. java file can only have one common class, and the file name must be the same as the class.
By default , a class is declared as default and can be used by other classes in the same package.
Abstract, a class is declared as an abstract class, which can have abstract methods or No. Abstract classes can only be inherited and cannot be instantiated.
final, declaring a class as final (that is, a non-inheriting class), indicating that he cannot be inherited by another class.
External classes cannot use modifiers such as protected, private, and static, and internal classes can be used.
3. Member Variable modifiers
Permission modifiers: Private, default, Protected,public
Status modifier: static,final
4. Constructor Method Modifiers
Permission modifiers: Private, default, Protected,public
The most used is public.
5. Member Method modifiers
Permission modifiers: Private, default, Protected,public
Status modifiers: Static, Final
Abstract modifier: Abstract used to modify abstractions in abstract classes and interfaces
6. Some combination methods
Member variable: public static final
Member Methods:
* public static
* Public abstract
* Public Final
Modifiers in Java and their usage