问题
I just read this line in book "Sun Certified Java Programmer" (page number-158) by Kathy Sierra and Bert Bates who worked as Master trainer at "Sun microsystems":
Polymorphism applies to overriding, not to overloading.
But some other books and articles say overloading is also a form of polymorphism.. i'm confused.. Please help..
回答1:
Don't believe the other books. Late binding (wiki) (with overriden/inherited methods) is polymorphism. Static binding is what applies to overloading.
The two bolded expressions are concepts you should familiarize yourself with as soon as possible. There are a number of available resources. Maybe start here.
来源:https://stackoverflow.com/questions/19406206/polymorphism-applies-to-overriding-not-to-overloading