Answer the question
In order to leave comments, you need to log in
"Method overloading is not polymorphism" or ignorance of the interviewer?
Here is a comment I had to hear from the interviewer. In answer to the question "What is polymorphism?" gave a general definition of polymorphism, which is the ability to change the behavior of an object with different data types, for example, when overloading methods.
At first, I even doubted it myself, but then I googled it - after all, this is a special case of polymorphism, and not just override of virtual methods.
What do you think is polymorphism in the implementation example in the code?
And what is the threat of employment in a company with such questions at interviews (from your experience)?
Answer the question
In order to leave comments, you need to log in
On Wikipedia the definition is
In programming languages and type theory, polymorphism is the ability of a function to handle data of different types.and special cases of polymorphism "ad hoc polymorphism" and "parametric polymorphism" are given.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question