正在加载图片...
Polymorphism(cont.) u Polymorphism Use the pointer or reference of the base class to point to any object of its derived class Thus we got transparency that we manipulate those real objects in a type-independent way Same code will represent different objects and make different behaviors Code will remain same if the inheritance hierarchy changesPolymorphism (cont.) ◼ Polymorphism ◼ Use the pointer or reference of the base class to point to any object of its derived class ◼ Thus we got transparency that we manipulate those real objects in a type-independent way ◼ Same code will represent different objects and make different behaviors ◼ Code will remain same if the inheritance hierarchy changes
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有