Discussion
Which of the following term describes the ability of a class to provide common interface for different types of objects in object-oriented programming ?
Answer: B
The term is polymorphism.
Polymorphism lets objects of different classes be used through one common interface: a call such as shape.draw() runs the right version for a circle or a square. It is achieved through inheritance with overridden methods, interfaces and overloading.
Encapsulation hides an object's data behind its methods. Inheritance lets a class acquire the members of another; it supports polymorphism but is not the ability itself. Abstraction exposes essential features while hiding detail.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development