Question
Which of the following best describes Abstraction in
Object-Oriented Programming (OOP)?Solution
Abstraction is a core concept of OOP that focuses on hiding unnecessary implementation details while exposing only the essential features of an object. This is achieved through abstract classes and interfaces. For instance, a Car class might expose methods like start() or drive() without detailing how the engine works internally. Abstraction simplifies the development process by allowing programmers to focus on high-level logic rather than low-level complexities. It also enhances security by preventing direct access to sensitive parts of an application. Why Other Options Are Incorrect : 2. Restricting access to certain parts of an object to protect data : This describes Encapsulation , not Abstraction. Encapsulation involves bundling data and methods together and using access modifiers to control visibility. 3. Combining different objects into a single unit to represent a relationship : This describes Aggregation , where objects are linked to represent "has-a" relationships, like a Library having Books. 4. Allowing multiple classes to share the same method name but with different implementations : This defines Polymorphism , specifically method overriding or overloading, and is unrelated to abstraction. 5. Establishing a parent-child relationship between classes : This is Inheritance , where one class derives from another, enabling code reuse and hierarchy building.
A and B entered into a business investing their capital in the ratio of 22:21, respectively and the respective ratio of time for which they made their i...
Raj invested Rs.32000 in a business. After 7 months, Rohan joins him with an investment of Rs.P. If at the end of the year the profit is Rs.55000 and pr...
- ‘M’ invested Rs. 36000 in a business. ‘N’ joined after ‘x’ months with an investment of Rs. 12000 less than ‘M’. If the ratio of the profit...
'A' and 'B' started a business by investing Rs. 4,200 and Rs. 5,600, respectively. If 'A' and 'B' invested their investments for 7 months and 9 months, ...
T, R and S entered into a business together for 2 years. T invests twice the amount Funded by R. R invests 2000 more than S. Out of the total profit o...
A, B and C started a online education website by investing Rs.40,000, Rs.45,000 and Rs.50,000 respectively. Find the share of A’s, out of an annual pr...
A and B started a business by investing Rs. 1200 and Rs. 675, respectively. They remained invested for periods in the ratio of 9:10. If A's share of the...
A and B entered into a business investing their capital in the ratio of 10:22, respectively and the respective ratio of time for which they made their i...
If a sum of money is to be divided among A, B, C such that A’s share is equal to thrice B’s share and B’s share is 7 times C’s share then their ...
A starts a business with Rs 12000. After 6 months B joins with Rs. 9000. After 2 years, what will be the ratio of the profit of A and B?