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
Want to remember what you got wrong?
Create a free account in seconds to track your score, revisit mistakes and continue Java Programming Language where you left off.
- Save your progress & streak
- Topic-wise quizzes & scores
- Bookmark tricky questions
- Printable MCQ sets
Nice — 3 questions done!
Don't lose this streak. Sign up free to save your score and pick up exactly where you stopped.
Share This Question
Challenge a friend or share with your study group.