Subclasses inherit from the parent class, inheriting a class by adding a colon after the class
Once an inheritance relationship is formed, the object of the subclass can use the public properties and method functions in the parent class
Subclasses can be converted to a parent class, but the parent class is not necessarily able to turn into subclasses
The parent class object can be converted back only if the parent object is converted by a subclass object.
From which subclass, you can only go back to that subclass.
Objects that are built directly from the parent class's constructor and cannot be converted to child class objects
When a method with the same name as the parent class is overridden in a subclass,
By which class the object points out the method, corresponding to that class inside the method content
Overridden method, if you add virtual in the parent class to override the subclass,
When you convert from a subclass object to an object of the parent class type, the child class method is called through the parent class object
Abstract class: Class name classes preceded by abstract
Abstract classes cannot create objects (instances) and can only be used as parent classes in an inheritance relationship
Other usages have the same inheritance usage as ordinary classes
Abstract method:
Can only be written in abstract classes
The content of the method must be overridden by override in the subclass
If not, then the subclass becomes an abstract class by default.
You have to inherit it somewhere else.
Abstract properties, note that the attribute is not a field.
As with abstractions, you need to rewrite them.
Interface:
A class can inherit only one parent class, but a class may inherit multiple interfaces
Interface cannot create its own instance, the interface cannot write segments, attributes
The method in the interface cannot have the method content, must be in the subclass to implement,
Implementation of the interface by the name of the point out method to achieve
Object-oriented Inheritance abstract interface