Is Method overloading is also known as static polymorphism?
posted 10 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Iam just newbie to java
In the below code I have oveloaded print method between two different classes
Based on object at runtime only corresponding print method will be executed.If my understanding is right then how can we say method overloading is considered to be static ploymorphism
[Added code tags - see UseCodeTags for details]
Please clarify me.Thanks in advance
In the below code I have oveloaded print method between two different classes
Based on object at runtime only corresponding print method will be executed.If my understanding is right then how can we say method overloading is considered to be static ploymorphism
[Added code tags - see UseCodeTags for details]
Please clarify me.Thanks in advance
posted 10 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
this is called method overriding, not method overloading.
posted 10 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Welcome to the Ranch
That isn't overriding because the parameters are different types.
Yes, people do say static polymorphism, but people use even more inaccurate and worse terms than that. Restrict the word polymorphism to mean overriding.
That isn't overriding because the parameters are different types.
Yes, people do say static polymorphism, but people use even more inaccurate and worse terms than that. Restrict the word polymorphism to mean overriding.
posted 10 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
It isn't germane to you question, but in both classes, this.arg is not being used. Only the arg parameter is.
All things are lawful, but not all things are profitable.
| get schwifty. tiny ad: The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |











