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.
- Which architecture is used in modern NLP tasks like BERT and GPT? 
- What is cohesion in software engineering? 
- Spark performs better than Hadoop MapReduce because: 
- Consider the following statement regarding DIAC. - Statement (1): DIAC is unidirectional device. - Statement (2): DIAC can be used for trigger... 
- Which of the following statements best describes a mesh topology in network design? 
- Which of the following algorithm uses Darwinian based algorithm to find the best solutions to solve complicated problems with a greater number of variab... 
- Which of the following statements best describes the concept of a computing model in computer science? 
- The is attribute in custom elements is used for: 
- ._______ method can be used for any SQL statements(Select and Update both). 
- Which statement is FALSE about open loop system?