Machine-translated by Google. Questions are authored in English.
Top

Discussion

What is polymorphism in OOP ?

  • A.The ability of an object to take many forms
  • B.The process of defining a method in the child class
  • C.The process of class inheritance
  • D.The ability to access private data members

Answer: A

Polymorphism is the ability of an object to take many forms.

The word means 'many forms'. In OOP, one interface can be used with objects of different types, and the method that runs depends on the actual object, as when a base-class reference calls an overridden method in a subclass, or one method name is overloaded for different arguments.

Defining a method in a child class is overriding, one way polymorphism is achieved. Inheritance is a separate concept, and access to private data is governed by encapsulation.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.