When you know that a subclass of a class will implement a method differently, it is useful to declare the class as an abstract class, and you can share the same parent class method without having to define it.
The relationship between abstract classes and abstract methods: classes containing abstract methods must be abstract, and abstract classes do not necessarily contain abstract methods. The meaning of the existence of abstract classes is to be inherited. A class inherits an abstract class and must implement all the abstract methods within the abstract class , otherwise, this class is also an abstract class.
The abstract modifier is used to decorate the class and member Method 1: Abstract classes are represented by an abstraction class, and abstract classes cannot be instantiated. 2: Abstract methods are represented by the abstraction method, and there is no method body for abstract methods. Abstract methods are used to describe what functions the system has, but do not provide specific implementations. Abstract rule: 1: An abstraction class can have no abstract method, but a class with an abstract method must be defined as an abstract class, and if a subclass inherits an abstract class and the subclass does not implement all the abstract methods of the parent class, then the subclass is also defined as an abstract class, otherwise the compilation will go wrong. 2: Abstract class does not have a constructor method , nor is it an abstract static method. But there can be non-abstract construction Method 3: abstract class cannot be instantiated, but can create a reference variable, the type is an abstract class, and let it refer to an instance of a subclass of a non-abstract class 4: Can not be decorated with the final modifier, (with the final how to inherit, hehe)
5: Another silly but important question: Abstract classes cannot be instantiated.
6:Abstract cannot be with final,private,static
Java abstract class attention issues