OverRiding Vs PolyMorphism

后端 未结 4 2285
醉梦人生
醉梦人生 2020-12-29 10:29

What is the difference between the two?

A super class having myMethod(int a) and an inheriting class having the same method, Is this overriding or poly

4条回答
  •  误落风尘
    2020-12-29 11:28

    yes...by using overriding we achieve the property of polymorphism ...when u have multiple class deriving from a single parent class ...there by using overriding ...we define the derived class method's functionality and as they are derived from same parent we show the property of polymorphism..

提交回复
热议问题