In the forum, there are questions about the manifestation of polymorphism,
And then there's a reply:
In Java, the polymorphism is embodied in two aspects, the first is the method overload generated by the compile-time polymorphism, the second is the video is covered by the method of the cover produced by the runtime polymorphism (parent class reference to child class object)
Landlord reply Thank you, and then there is a reply:
There are three forms of polymorphism in Java: 1, method of replication, 2, overloading of methods 3, polymorphism of objects
See so neat answer, almost thought it was the standard answer.
In a pragmatic spirit, I silently opened the
"Bi Xiangdong Java video Eighth day 02 object-oriented polymorphism (extensibility)" this video.
At the end of the video, Mr. Bi simply summed up some of the polymorphic knowledge Points:
The manifestation of polymorphism
The parent class reference points to its own subclass object
A reference to a parent class can also receive its own child class object
The premise of polymorphism
Must be a relationship between a class and a class. Either inherit, or implement.
There is usually a premise: there is an overlay
The benefits of polymorphism
The appearance of polymorphism greatly improves the expansibility of the program.
The drawbacks of polymorphism
Extensibility is improved, but members in the parent class can only be accessed with the parent class reference.
Well, at a glance.
From the manifestation of polymorphism ...