Parent Class F = new subclass ();
Reference variable F, at compile-time type is the parent class, at run-time type is subclass type. When this reference variable calls the subclass to override that method of the parent class, the actual execution is the overridden method in the subclass. When the method of invoking the variable is run, its method behavior always shows the behavior characteristic of the subclass method, not the behavior characteristic of the parent class method, which may appear: the same type of variable, the same method is called to render a variety of different behavior characteristics, this is polymorphic.
F. Subclass-Unique method, so that although the F reference variable actually contains this method, it is compiled with the parent class type and therefore an error.
Unlike methods, an instance variable of an object does not have a polymorphic f. Variable (the parent class subclass exists), but the output is a variable of the parent class
Coercion type conversions for reference variables
instanceof operator
Crazy Java Handout-polymorphic