Final is primarily used to modify classes, methods, and properties
When used to decorate a class, the class cannot inherit from the quilt class, in other words, the class has no subclasses
This method cannot be replicated when used in a modified method.
The same attribute value cannot be changed when used to decorate a property
Abstract class, when there is an abstract method, the class is an abstract class that needs to be added with the abstract modifier, and the abstract method must be overridden by the subclass that inherits it.
Interfaces can be implemented in many ways and can be understood as a special class, except that the class consists of constants and common abstract methods.
Interface demo{public static final int. age = ten; public abstract void Tell () {}}interface demo2{public abstract void Say () {}}//An interface can inherit multiple interfaces, Compensate for the lack of single inheritance interface Demo3 extends Demo,demo1{}class m{public abstract void printf () {}}class A extends M implements de mo,demo2{//must make a copy of the Tell method public void Tell () {} public void Say () {}}class go{public static void main ( String[] args) { a a=new a (); A.tell (); A.say (); A.printf (); }}
An interface can implement single-inheritance superclass, but can inherit the interface, can compensate for the lack of single inheritance
A class can inherit multiple interfaces, single-inheritance superclass
The difference between an interface and an abstract class:
The inheritance interface must replicate all of the methods inside, and the interface is not private variables or methods, but the abstract class can have its own private variables or methods, but also must be a copy of the abstract methods, others can see the needs of the program to be properly replicated.
About the final keyword and abstract class, interface