Is Method Overloading considered part of polymorphism?
Method Overloading is a Compile time polymorphism.
-Overloading is when you take an existing method and essentially define it again, but using different parameters which Java sees as a completely different method. -Polymorphism is when you extend the base functionality of a superclass.
Overriding is when you call a method on an object and the method in the subclass with the same signature as the one in the superclass is called. Polymorphism is where you are not sure of the objects type at runtime and the most specific method is called.
Overloading is a form of polymorphism (parametric polymorphism) in the case that a method with the same name can behave differently given different parameter types. Overloading is when you have the same function name that takes different parameters.
There are different types of polymorphism:
So yes it is part of polymorphism.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With