Late Binding vs. Polymorphism - what is the difference?

一世执手 提交于 2019-12-21 12:18:28

问题


I've seen both used interchangebly but do they really mean the same? From my understanding, Polymorphism stretches the fact that you could exchange an instance of a class by an instance of a subclass, and Late Binding means that when you call a method of an instance, the type decides which method (subclass/superclass) gets called.


回答1:


Wikipedia has a very nice article about this:

http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming

Summary: Late binding is a way to implement polymorphism.



来源:https://stackoverflow.com/questions/3670726/late-binding-vs-polymorphism-what-is-the-difference

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!