1

Are method overloading and method overriding justify as a example of oops Polymorphism ?, As there is nothing about object polymorphism in overloading and overriding.

(May be overriding somehow connect with object but overloading has nothing with object)

kundan bora
  • 3,821
  • 2
  • 20
  • 29
  • Is this Q specific to java or c++? It is tagged `java` but looks more c++ish. – Alok Save Mar 22 '12 at 09:26
  • 3
    Java doesn't have operator overloading. Did you mean method overloading, overriding and hiding ? – Yochai Timmer Mar 22 '12 at 09:29
  • thanks Yochai Timmer for your correction. @Als this is common oop concept question but put with java (As I am java programmer). – kundan bora Mar 22 '12 at 09:47
  • Similar question: [Polymorphism vs Overriding vs Overloading](http://stackoverflow.com/questions/154577/polymorphism-vs-overriding-vs-overloading). BTW, it is **OOP** and not **OOPs**! – Devendra D. Chavan Mar 23 '12 at 13:48

1 Answers1

0

Method overloading: An object may behave differently (for the same operation it has been called for), depending on: 1. Its data (fields, properties) 2. Non class Property parameters It does not seem to change its shape (polymorphisms) in such cases.

Method overriding: An object may behave as itself (method called in its own class), or it may behave as the Parent class. In the later case the object changes itself to its parent. Hence, we see that overriding has everything to do with polymorphism

blogbydev
  • 1,445
  • 2
  • 17
  • 29