Polymorphic:
1 Meaning:
1.1 References of the same type point to different objects are polymorphic that have different implementations-----behavior
1.2 When the same object is shaped into different types, there are different functions--------the polymorphism of the object
2 Up Styling:-----Automatic type conversion
2.1 Super-type references to objects of derived classes
2.2 Types that can be shaped are: Super Class + interface implemented
2.3 Can point out what, see the type of reference
3 Forced type conversion, the success of the condition only the following two kinds:
3.1 The object that the reference is pointing to, which is the type
3.2 The interface is implemented by referencing the object to which it is pointing.
ClassCastException type conversion exception occurs when the 4 strong turns do not meet the above two conditions
Recommendation: Use instanceof to determine if the object you want to refer to is the type before a strong turn
Java Object-oriented polymorphism