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.
Geography books are never together.
From 6 officers and 8 Jawans, in how many ways can 5 be chosen to include exactly 3 officers?
In how ways can the selection be made so that a particular member is always included?
...- There are 3 identical toys and 4 identical books. How many distinct arrangements are possible on a shelf such that all three toys do not appear together?
Find the number of ways to arrange each letter of the word 'RECREATION' such that all the vowels always come together.
Find total number of ways in which the word “AGGRESSION” can be arranged.
Out of 6 men and 3 women a committee of 3 members is to be formed so that it has 2 men and 1 woman. In how many different ways can this be done?
Five students are to be arranged on five chairs for a photograph. Three of these are girls and the rest are boys. Find out the total number of ways in w...
- A group consists of 10 boys and 6 girls. In how many ways can 6 boys and 2 girls be selected from the group?
Find the number of ways to arrange each letter of the word 'PROFESSION' such that all the vowels always come together.