ITPEC FE Subject A October 2024 Question 35
In object-oriented programming, which of the following is abstraction?
Explanation
Hiding implementation details behind a simplified interface — abstraction lets users work with what an object does, not how it does it.
Abstraction picks out an object's essential characteristics and exposes them through a simple interface (in code, an abstract class or interface), while the internal details stay hidden. Code that uses the object depends only on that interface, so the implementation can change without affecting it. Encapsulation, which bundles data with its methods and restricts access, supports the same hiding.
Answer (a)
Why not others:
- •(b) — a subclass taking over attributes and behaviors from its superclass is inheritance
- •(c) — several methods with the same name but different parameter lists is overloading
- •(d) — a subclass redefining a superclass method with the same name and parameters is overriding, the basis of runtime polymorphism
Key rule: Inheritance reuses a superclass, overloading varies the parameters, overriding varies the implementation, and abstraction exposes only the essential interface.
System Development Technology · AI-written, may contain errors
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.