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.
рдХреЛрд╖реНрдардХ рдореЗрдВ рджрд┐рдП рдЧрдП рд╢рдмреНрдж рдХрд╛ рд╕рд╣реА рдкрд░реНрдпрд╛рдпрд╡рд╛рдЪреА рдЪреБрдирд┐рдПред
рдЙрд╕ рдШрдЯрдия┐╜...
рдиреАрдЪреЗ рджрд┐рдП рдЧрдП рд╡рд╛рдХреНрдп рдХреЗ рд░рд┐рдХреНрдд рд╕реНрдерд╛рди рдореЗрдВ рдЙрдЪрд┐рдд рд╢рдмреНрдж рднрд░рд┐рдпреЗ
рджрд╕я┐╜...
рдирд┐рдореНрдирд▓рд┐рдЦрд┐рдд рд░рд┐рдХреНрдд рд╕реНрдерд╛рди рдореЗрдВ рдЙрдЪрд┐рдд рд╢рдмреНрдж рднрд░рд┐рдПтАУ
рдЖрдзреБрдирд┐рдХ рд╢рд┐рдХ...
рдирд┐рдореНрдирд▓рд┐рдЦрд┐рдд рд░рд┐рдХреНрдд рд╕реНрдерд╛рди рдореЗрдВ рдЙрдЪрд┐рдд рд╢рдмреНрдж рднрд░рд┐рдП тАУ┬а
тАЬ рд▓реЛрдХрддрдВрддреН...
рдирд┐рдореНрдирд▓рд┐рдЦрд┐рдд рдкреНрд░рд╢реНрди рдореЗрдВ рд░рд┐рдХреНрдд рд╕реНрдерд╛рди рдХреЗ рд▓рд┐рдП рд╕рд╣реА тАШрднрд╛рд╡рд╡рд╛рдЪрдХ рд╕рдВя┐╜...
рдХреБрдЫ рд╕рд╛рдБрдк ----------------------рд╣реЛрддреЗ рд╣реИрдВред┬а
рдорд╛рдирд╡ рд╢рд░реАрд░ рдореЗрдВ рдкреЛрд╖рдХ рддрддреНрд╡реЛрдВ рдХреА рдХрдореА рдХрд╛ рдкреНрд░рднрд╛рд╡ рдзреАрд░реЗ-рдзреАрд░реЗ __________ рд░я┐╜...
рджрд┐рдП рдЧрдП рд╡рд╛рдХреНрдпреЛрдВ рдореЗрдВ рд░рд┐рдХреНрдд рд╕реНрдерд╛рдиреЛрдВ рдХреА рдЙрдЪрд┐рдд рд╢рдмреНрджреЛрдВ рджреНрд╡рд╛рд░...
рдирд┐рдореНрдирд▓рд┐рдЦрд┐рдд рд░рд┐рдХреНрдд рд╕реНрдерд╛рди рдореЗрдВ рдЙрдЪрд┐рдд рд╢рдмреНрдж рднрд░рд┐рдП тАУ
рдПрдХ рд╕рдлрд▓ рд╡рд╛рд░я┐╜...
рд╕рдордп рд╕рддрдд _____ рд╣реИред