Question
Which OOP principle focuses on showing only essential
information and hiding the complex implementation details from the user?Solution
o Abstraction is the principle of hiding complex implementation details and showing only the necessary or relevant information to the user. It focuses on "what" an object does rather than "how" it does it. For example, when you drive a car, you interact with the steering wheel and pedals (the abstract interface) without needing to know the intricate details of the engine or transmission (the hidden implementation). o Encapsulation (A) is the bundling of data and methods that operate on the data within a single unit (e.g., a class) and restricting direct access to some of the component's internals. It's a mechanism often used to achieve abstraction, but it's not the concept of hiding complexity itself. o Inheritance (B) is a mechanism where one class acquires the properties and behaviors of another class. o Polymorphism (C) allows objects of different classes to be treated as objects of a common type, enabling a single interface to represent different underlying forms. o Association (E) describes a relationship between two separate classes where one class uses the services of another class.
Hari scored 70 marks in English. He scored 64% marks in Hindi and X marks in Maths. The maximum marks for each subject is 175. The overall percentage of...
After increase in the price of coffee by 25%, a person is able to buy 4 kg less for Rs. 1,640. Find the original and increased price of the coffee per k...
Raj has 120 kg of apples (rotten and fresh). He sold 30% of the total apples such that out of the remaining apples, 20% are rotten. Find the percentage ...
The population of a town increases by 5% every year. If the population of the town at the beginning of 2020 was 50,000, what will the population be at t...
From the salary of a software engineer, if 15% is used as house rent, 25% of the remaining is spent on household items, 25% of the remaining as income t...
Fresh mushrooms are 90% water, but after drying they retain only 20% water. How much fresh mushroom is needed to make 1 kg of dried mushroom?
Out of 600 students in school, 40% students like samosa only and 30% students like samosa and momos both. If 22% students don’t like any snacks then f...
- During a club election between members 'X' and 'Y', 10% of all votes were invalid. If 'X' got 52% of the valid votes and 'Y' secured 21,168 valid votes, de...
- In a certain examination, Neha got 46% and was 10 marks short of passing. Kunal got 52% and scored 8 marks more than required. What are the passing marks?
Income of Riya is Rs. (124n + 1680). She spends 75% of her income and saves the rest. Savings of her friend Mehul is Rs. 960 more than that of her. Mehu...