First, Final keywords:
The 1.final keyword in Java is called the end device, which means the final meaning
2.final can declare classes, methods, properties:
Classes that use Final declaration cannot be inherited
Methods that use Final declaration cannot be overridden
Variables declared with fanal become constants, and constants cannot be modified. When a variable becomes a constant, uppercase is generally used, for example: final int age = 22;
Second, abstract class:
1. A class that contains an abstract method is an abstract class.
2. a method that is declared without being implemented is an abstract method. You must use the abstract declaration.
3. Abstract class quilt inheritance, it cannot be instantiated directly, it must be instantiated through its subclasses. If the subclass is not an abstract class, you must override all abstract methods in the abstract class.
4. Format:
Abstract class classname{attribute//1 method//2 Abstraction Method//3 1, 2, 3 is not required, but optional }
Third, the interface:
1. Interfaces can be understood as a special class, all of which are composed of global constants and common abstract methods .
Examples of global constants: public static final int. age = 100;
2. Format:
Interface interfacename{Global constant//1 abstract method//2 1, 2 is optional}
3. The implementation of the interface must also be through subclasses, using the keyword implements, and the interface can be implemented more
4. A subclass can inherit abstract classes and implement interfaces at the same time
5. An interface cannot inherit an abstract class, but it can inherit multiple interfaces at the same time through the Extens keyword, implementing multiple inheritance of the interface. Compensate for the lack of single inheritance in Java.
Java object-oriented-abstract classes and interfaces