In general, publications, some even well-known, can be wrong. In fact, everyone can. There’s a lot of wrong stuff out there, often just for some carelessness.
Note that in this case they are different articles from different authors, so it is normal that each one has a view, here you will see another(s). One is not always wrong just because it is different from the other. Not in this case, but it is also good to always look at the date of publication. And the author’s credentials, because paper and HTML accept everything.
The overload of methods (Overload) is a concept of polymorphism that consists basically in creating variations of the same method, ie the creation of two or more methods with totally equal names in a class. Overload allows us to use the same name in more than one method as long as its argument lists are different so that they are separated
Could be a polymorphism ad-hoc, but people don’t usually use this term in everyday life.
The text is confusing and incomplete, but it is technically correct. The article as a whole is full of strange and even clearly incorrect things in the details.
Polymorphism is the principle whereby two or more classes derived from the same superclass may invoke methods that have the same identification, signature, but distinct, specialized behaviors for each derived class, using for this purpose a reference to an object of the superclass type. Overload is not a type of polymorphism, because with Overload the signature of the method must have different arguments, requirement that hurts the concept of polymorphism mentioned above
Why do you need at least two classes? Isn’t one enough? It’s already started badly. usando para tanto uma referência a um objeto do tipo da superclasse
seems confused or just incorrect even. I like this school more to consider the Overload as something different, although theoretically it is, in practice we do not use this term.
He should quote where there is the requirement that the signature should be equal to be polymorphism. I have the impression that he can not, this has no foundation. I say so because he is basing. If you were just to quote, okay, if it’s just to use different terms for each mechanism, that’s good to make it easier to communicate the intention.
The article has other things kind of "loose".
to be polymorphism there has to be overload of method, pus as wrong, so I hit right?
There are controversies. The classical overload is horizontal, is to have methods with the same name, but with different signatures. Some call vertical overload polymorphism where an identical method in the signature behaves differently depending on the level of inheritance it is in. But I prefer to call only polymorphism to avoid confusion. And it can occur dynamically, the most common, or static in general with templates or Generics.
I wouldn’t trust the articles.
Related: What are the differences between Overriding and overloading in Java?
– user28595
Related: When and why we should use polymorphism?
– user28595
Many thanks friends...so to take advantage of the topic: today I had a proof of OO concepts in Java, to point out, and one issue that I came home encucado was about polymorphism, the statement was that to be polymorphism there has to be overload of method, I called it wrong, so I got it right? Since if there is only superscript method it is already polymorphism, correct?
– Douglas da Dias Silva