One, polymorphic use mode
1, the parent class object type points to the subclass object.
Two, polymorphic advantages
1, in the parameters of a function or method, the parent class object type can accept multiple-seed-class-object-passed parameters at the same time.
2, when a subclass object is pointed to by the parent object type, you can call the parent class method directly, but you cannot call the specific method of the subclass directly, and if necessary, you need to cast the object type to subclass type.
Three, the limitations of polymorphism
1, the Subclass object type cannot point to the parent class object. (the compiler warns you, but it works, or it is not recommended)
2, a subclass that inherits from the same parent class object cannot point to each other. (the compiler warns you, but it works, or it is not recommended)
I summarize myself, if there is a mistake to correct, thank you.
Objective-c one of the three major characteristics: polymorphism