Question
In OOP, what term best describes the relationship where
one object is a part of another but cannot exist independently?Solution
Composition is a "has-a" relationship where one object contains another, and the contained object cannot exist independently of the parent. 1. Dependency: For instance, an engine is part of a car and cannot function independently outside of it. 2. Tight Coupling: The lifecycle of the child object depends entirely on the parent object. If the parent is destroyed, the child is destroyed too. 3. Reusability: Composition fosters code reuse by enabling modular design without strict inheritance hierarchies. Option A exemplifies composition through its strong containment relationship, central to creating complex, interdependent systems. Why Other Options Are Incorrect: • B) Aggregation: Denotes a weaker "has-a" relationship, where components can exist independently. • C) Inheritance: Refers to property sharing, not containment. • D) Polymorphism: Focuses on method behavior variability. • E) Association: A general relationship without specific containment rules.
If 6 4 x 5.75 9,
Then, (x²-1) = ?
...3 2 10 ? 17 16
...16, 8, 8, ?, 24, 60
Identify the given logic and complete the series with the correct option. 12, 15, 18, 20,?
?     12     24     44     74     116
...6   16  ?     244  1,245  7,506  52,591
4                14                  130                     512                �...
29    51    95    183    ?     711
1001, 728, 513, 342, 217, ?
6 3.5 2.5 ? 8.5 23.75
...