
so this is how we demonstrate Human a = new Human() same as if you create a instance of SuperHuman then there is one method and one expected behavior so there is no polymorphism. Why because if you create a instance of human then there is one method so there is no polymorphic behavior. So we know that SuperHuman is also having ability to eat but differently, but not like overloading now here we have a problem of demonstrating the polymorphism. In method override you override a method which is defined in the super class.Įx : human has a eat method and now you create a SuperHuman class which is a subclass of the human and then override the eat method Then how method overriding is polymorphism? lets try to figure this out. in simple words polymorphicĮxample : you have eat method in human class now you create another eat method with different parameter list, according to which method you call expected behavior changes. same name means -> same behavior but we know even though the name is similar behavior is not exactly the same. In OOP method represents a behavior, using method overloading technique in java you can create a method which has the same name but different parameter list, now lets start thinking.

now lets think how method overloading represent polymorphism Meaning of polymorphism in OOP is ability of object to behave differently. Don't go too technical at first, try to understand from the meaning.
