Start learning 50% faster. Sign in now
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.
One of my friend(A)/ has gone(B)/ to Canada.(C)/ No error(D)
In these questions some of the sentences have errors and some have none. Find out which part of a sentence has an error and indicate it corresponding t...
They had to put of the garden party because of the heavy rain.
Directions: In each of the questions, a sentence has been divided into four parts, one of which may contain an error. Identify that fragment and mark ...
In the following question, a sentence is divided into five parts namely A, B, C, D and E in which two of the parts have some grammatical or contextual ...
The MNC recently roped in a new head of the HR department.
In my opinion (A)/a pencil is always (B)/ more preferable to a pen.(C)/ No error (D)
The following sentence has been split into four segments. Identify the segment that contains a grammatical error.
This jewellery box is made from...
Everyone knows that (1)/ the Earth revolves around the sun, (2)/ but there are still some people (3)/ who denies it. (4)
Read each sentence to find out whether there is any error in it. The error, if any, will be in one part of the sentence. Mark the part with the error a...