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.
The LCM of two numbers is 960 while their product is 7680. Find the greatest common divisor of the two numbers.
The HCF of two numbers is 6 and their LCM is 84. If one of these numbers is 42, then the second number is:
The HCF of two numbers is 14. Which of the following can never be their LCM?
The product of two numbers is 1344 and their L.C.M is 168. What is the H.C.F of the two numbers?
- The sum and difference of L.C.M and H.C.F of two numbers is 216 and 184. If one of the numbers is 25, then find the other number.
The HCF and LCM of the two numbers are 225 and 360 respectively. When the first number is divided by 3, the quotient is 20. The other number is.
Find the LCM of the numbers 1.2, 0.8, 2.4, and 3.6.
Two numbers are in the ratio 2:8. The product of their H.C.F. and L.C.M. is 3600. The sum of the numbers is: