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.
рдПрдХ рдХреА рд╡рд░реНрддрдиреА рд╢реБрджреНрдз рд╣реИред
рдЬрд┐рд╕ рд╕рдорд╛рд╕ рдореЗрдВ рдкрд╣рд▓рд╛ рд╢рдмреНрдж рдкреНрд░рдзрд╛рди рд╣реЛрддрд╛ рд╣реИ , рдЙрд╕реЗ рдХрд╣рддреЗ рд╣реИрдВ :
рджрд┐рдП рдЧрдП рд╡рд╛рдХреНрдпреЛрдВ рдореЗрдВ рдПрдХ рд╡рд╛рдХреНрдп рд╢реБрджреНрдз рд╣реИ рдФрд░ рддреАрди рдЕрд╢реБрджреНрдз рд╣реИрдВя┐╜...
рдкреНрд░рдзрд╛рдирдордВрддреНрд░реА рдиреЗ рднрд╛рд╖рдг рджрд┐рдпрд╛, рдХрд┐рд╕ рдкреНрд░рдХрд╛рд░ рдХрд╛ рд╡рд╛рдХреНрдп рд╣реИ ?
' рдмрд╛рд╣рд░ рдирд┐рдХрд▓рд╛ рд╣реБрдЖ / рдмрд╛рд╣рд░ рд╡рд╛рд▓рд╛тАЩ рдХреЗ рд▓рд┐рдП рдПрдХ рд╢рдмреНрдж :
рдирд┐рдореНрдирд▓рд┐рдЦрд┐рдд рд╡рд╛рдХреНрдпреЛрдВ рдореЗрдВ рд╢реБрджреНрдз рд╡рд╛рдХреНрдп рд╣реИ
┬ардирд┐рдореНрдирд▓рд┐рдЦрд┐рдд рд╕рдорд╕реНрдд рдкрджреЛрдВ┬а рдореЗрдВ рджреНрд╡рд┐рдЧреБ рд╕рдорд╛рд╕ рдХрд╛ рдЙрджрд╛рд╣рд░рдг рдмрддрд╛я┐╜...
рдореМрди рдХрд╛ рд╡рд┐рд▓реЛрдо рд╢рдмреНрдж рд╣реИ
рдореИрдВ рд╕реНрд╡рдпрдВ рдЪрд▓реА рдЬрд╛рдКрдБрдЧреАред рд╡рд╛рдХреНрдп рдореЗрдВ рдореЛрдЯрд╛ рд╢рдмреНрдж рдХрд┐рд╕ рдкреНрд░рдХрд╛рд░ рдХрд╛ рд╕рд░...
рд╡рд░реНрддрдиреА рдХреА рджреГрд╖реНрдЯрд┐ рд╕реЗ рдЗрдирдореЗрдВ рд╕реЗ рдХреМрди рд╕рд╛ рд╢рдмреНрдж рд╢реБрджреНрдз рд╣реИ ?