QWhich of the following is a pillar of Object-Oriented programming?
Question Info
Choose the Best Option
Click any option to instantly check if you're correct.
Explanation
The correct answer is: Polymorphism
Polymorphism is one of the four fundamental pillars of Object-Oriented Programming (OOP). The other three pillars are:
-
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.
-
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.
-
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.