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.
V is the son of Y. C is the son of U. The mother of V is L who is sister of U. How is Y related to U?
In the following question, select the related word from the given alternatives.
FLOWER : LFWORE:: ANSWER: ?
Select the option that is related to the fifth term in the same way as the second term is related to first term and the fourth term is related to the t...
Medicine : Dispensary  ::  Aeroplane : ?
Select the option that is related to third letter cluster in the same way first letter-cluster and fifth-letter cluster is related to second number-clus...
Select the option that is related to the third term in the same way as the second term is related to the first term.
AOE : FUJ :: RKT : ?
Which of the following statement is right?
Statements:
Only a few Rolex are Fastrack.
Only a few Rolex are Titan.
Only a few Timex are Fastrack.
Conclusions:
<...Find the odd one out pair.
Select the option that is related to the third word in the same way as the second word is related to the first word.
Ephemeral : Temporary :: T...