With polymorphism:

  1. one method can have multiple names.

  2. one object can have multiple names.

  3. many methods can share the same name.

  4. many objects can share the same name.

  5. None of the above statements are true.


Correct Option: C
Explanation:

To understand the concept of polymorphism, it's important to have knowledge of object-oriented programming and the principles of inheritance and method overriding. Polymorphism is a concept in object-oriented programming that allows objects of different classes to be treated as objects of a common superclass. This concept enables different classes to have methods with the same name, but different implementations.

Now, let's go through each statement and explain whether it is true or false:

A. one method can have multiple names: This statement is false. In polymorphism, multiple methods can have the same name, but they must have different parameter lists or be defined in different classes.

B. one object can have multiple names: This statement is false. An object can have one name and can be referred to by a single reference variable.

C. many methods can share the same name: This statement is true. Polymorphism allows multiple methods with the same name but different parameter lists to be defined in different classes or even within the same class.

D. many objects can share the same name: This statement is false. Each object has a unique identity and is referred to by a specific reference variable.

E. None of the above statements are true: This statement is false. Statement C, "many methods can share the same name," is true.

So, the correct answer is C. Many methods can share the same name.

I hope this clarifies the concept of polymorphism for you. Let me know if you have any further questions.

Find more quizzes: