1 When you use the abstract keyword to decorate a class, a class is called an abstract class;
When you use abstract to modify a method, the method is called an abstract method.
2 classes that contain abstract methods must be declared as abstract classes
Abstract classes must be inherited, and abstract methods must be overridden.
Abstract classes cannot be instantiated.
3 When a method is declared with the abstract keyword, then the class is incomplete, and the class must also be declared abstract, and the class cannot be instantiated.
If the abstract method is not overridden in a subclass, the subclass will also error. The best solution is to override the method in a subclass, and if you really think that this method should not be overridden, you can also declare the method as abstract in the subclass, which is also the abstract class.
Abstract classes and Methods summary:
In an abstract class, there can be no abstract method. But if there is an abstract method in a class, the class must be an abstract class.
[Java] [VIDEO] Notes-abstract class