1. Abstract function syntax features (natural to be used as Father's) definition: only function definition, no function body function (no entity). cannot be initialized.
Abstractvoid Fun (); classes defined with abstract are used as abstract classes
Characteristics:
1.Abstract classes cannot be used to create objects of new type, and are inherently inherited;subclasses inherit abstract classes, and then replicate abstract functions so that the class is not an abstract function. To generate child class objects.
2.If a class contains abstract functions, then the class must be declared as abstract class;
3.If there is no abstract function in a class, the class can also be declared abstract so that the object is not generated by others. In the future, it is used to write programs, and abstract is also called the base class for inheritance. 2. Abstract classes can have constructors? Condition: Abstract classes do not actually generate objects, but because of inheritance, subclasses can generatethere are constructors that invoke the constructor of the abstract class when generating the subclass object. Abstract classes must be extend. object is not an abstract class in full sense, because it does not have a method that must be overridden.
3. The role of abstract classesNote: If a piece of code is semantically wrong, there should be a syntax error, and grammatical errors are easier to find than semantic errors. For example, if a parent class is not an abstract class, it is possible for a subclass to forget the replication of some functions of the parent class and not be easily discoverable.if a class, a function we cannot determine. Must be implemented with subclasses and cannot be generalized, the function is defined as an abstract function, and the class is defined as an abstract class.
From for notes (Wiz)
9. Abstract classes and abstract functions