Which of the following concepts allows hiding internal complexity?

202420242024

Which of the following concepts allows hiding internal complexity?

  1. A.

    Polymorphism

  2. B.

    Abstraction

  3. C.

    Inheritance

  4. D.

    Encapsulation

Attempted by 7 students.

Show answer & explanation

Correct answer: B

In object-oriented design, abstraction is the principle of exposing only the essential features of a system to the user while hiding the internal implementation details and complexity that the user does not need to know.

The question asks which concept lets a user work with a system without being burdened by its internal complexity — that is precisely the role abstraction plays. Consider a person driving a car: pressing the accelerator increases the car's speed, but the driver need not know how the fuel injection, engine, or transmission actually produce that increase. The car exposes only the essential controls (accelerator, brake, steering) and hides the underlying complexity — this is abstraction in action.

Contrast with the other OOP pillars offered:

  • Polymorphism lets objects of different types respond to the same call in their own way — it is about behavioural flexibility, not about hiding complexity.

  • Inheritance lets one class acquire the properties and behaviours of another class for reuse across a hierarchy — it is about structural reuse, not about hiding complexity.

  • Encapsulation bundles an object's data and methods together and restricts direct access to protect internal state — its focus is data protection and access control, not simplifying what a user needs to know about the design.

Explore the full course: Hexaware Preparation