Single Choice Moderate

QWhich of the following is a pillar of Object-Oriented programming?

ID: #19897 Basic Concept of OOP 93 views
Question Info
#19897Q ID
ModerateDifficulty
Basic Concept of OOPTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A Variable
  • B Polymorphism
  • C Super class
  • D Sub class
Correct Answer

Explanation

The correct answer is: Polymorphism

Polymorphism is one of the four fundamental pillars of Object-Oriented Programming (OOP). The other three pillars are:

  1. Encapsulation: Involves bundling data and methods that operate on the data into a single unit (class) and controlling access to the internal details of the object.

  2. Inheritance: Allows a new class (subclass or derived class) to inherit attributes and methods from an existing class (superclass or base class), promoting code reuse.

  3. Polymorphism: Enables objects of different types to be treated as objects of a common type. This can occur at compile time (compile-time polymorphism) through method overloading and operator overloading, and at runtime (run-time polymorphism) through method overriding.

So, while superclass and subclass are related to inheritance, and variable is a general term in programming, polymorphism is a specific pillar of Object-Oriented

Share This Question

Challenge a friend or share with your study group.