How many types of polymorphism are there in java. I don't agree on two types of polymorphism in java. People use to say there are 2 types of polymorphism in java, static(method overloading) and dynamic(method overriding). But ideally there won't be any polymorphism without inheritance. Method overloading can be achieved without inheritance so its not a pholymorphism. Only method overriding is a actual method overriding as it can be done only after inheriting the parent class. Similarly there won't be inheritance without Abstraction. Any comments on this will be appreciated so please give your view on polymorphism in java.
Overloading isn't polymorphism. Overloading is simply allowing two methods to share a name, as long as they take different parameters. It would be nice if we could at least say about overloading, "it is broadening the definition of behavior X so that it can accommodate different kinds of input". But we can't, because overloaded methods aren't required to be related to each other at all.