A
As can be seen from the source code, subclasses can be directly assigned to the base class ("base class variable = Subclass Object"), the reference type of the base class to be passed to the subclass must pass the cast ("sub-class variable = (subclass name) base class object");
No conversions can be made between subclasses.
Two
The source code can be summed up:
When a base class has a variable of the same name as a subclass, the reference variable is the reference, and the variable that refers to which class is called;
When a base class has a method with the same name as a subclass, whichever is the type of the object, and the method of which class is called;
Conversion between a base class and a subclass: A base class variable can directly refer to a subclass object, or directly assign a subclass object to a base class variable;
However, when a base class object is to be converted to a subclass variable, it must be cast.
The conversion between a base class and a subclass is simply a conversion of a reference type, and it does not change the real object.
Reference conversions between a base class and a subclass