Use of the Java abstract class
When the same functionality appears in multiple classes, but the functional body is different,
This is available for upward extraction. At this point, only the function definition is extracted, not the functional body.
Abstract: Can not understand.
Features of abstract classes:
1, the abstract method must be in the abstract class.
2, both abstract methods and abstract classes must be decorated with the abstract keyword.
3, abstract classes can not create objects with new. Because it doesn't make sense to invoke an abstract method.
4, abstract methods in the abstract class to be used, the subclass must be replicated all the abstract methods, the child class object call.
If a subclass overrides only a subset of the abstract methods, then the subclass is an abstract class.
Abstract classes and general classes are not much different.
How to describe things, how to describe things, but there are some things that things do not understand.
These uncertain parts, and the function of the thing, need to be clearly present. However, the principal cannot be defined.
Represented by an abstract method.
Abstract analogies generally have multiple abstract functions. is to define an abstract method in a class.
An abstract class cannot be instantiated.
Special: Abstract methods may not be defined in a class, and this simply does not allow the class to establish an object.
The abstract class of Java learning