Question
Which feature of OOP allows hiding implementation
details while showing only the necessary functionality?Solution
Abstraction allows a programmer to focus on essential features of an object while ignoring the underlying complexity. It defines the "what" of functionality without exposing the "how." For example, an interface Vehicle may have a method drive() without specifying how it operates. Different classes like Car and Bike can implement drive() in their way while hiding their internal details. Abstraction is achieved using abstract classes and interfaces. It simplifies system design by providing a clear separation of concerns, enabling developers to focus on high-level interactions rather than low-level details. Why Other Options Are Wrong Option A : "Inheritance" Inheritance enables code reuse by sharing functionality but does not inherently involve hiding implementation details. Option C : "Encapsulation" Encapsulation protects and restricts access to data but is more concerned with access control than hiding implementation logic. Option D : "Polymorphism" Polymorphism deals with dynamic method binding and does not focus on hiding details. Option E : "Composition" Composition models "whole-part" relationships and is unrelated to abstraction.
From when will RBI’s bar on prepayment penalties for floating rate loans to MSEs be effective?
Bhadra Tiger Reserve, recently seen in news, is located in which state?
What is the primary focus of AgriHub, the AI-driven Center of Excellence launched by MeitY and IIT Indore?
What is the main purpose of the AgriSURE Fund launched by the Union Agriculture Minister?
What is the renewable energy capacity target that India aims to achieve by 2030?
What is India’s projected GDP growth for FY26 according to ICRA?
NITI Aayog’s report “Pathways to Progress” focuses on which area?
The government of India slashed the windfall tax on domestically produced petroleum crude to what value effective from September 18, 2024?
What unique feature does the HSBC Taj Credit Card emphasize?
What is the primary aim of APEDA’s ‘Indian Mango Mania 2025’ campaign held in Abu Dhabi?