Question
What type of relationship is represented by Aggregation
in Object-Oriented Programming?Solution
Aggregation is a "has-a" relationship where one object is composed of other objects, but the lifecycle of the contained objects is independent of the containing object . For example, a Teacher class might be associated with a School class, but even if the School object is destroyed, the Teacher object can continue to exist. Aggregation emphasizes shared ownership and loosely coupled associations, making it useful for scenarios requiring flexibility in object dependencies. Why Other Options Are Incorrect :
- "Is-a" relationship : This refers to Inheritance , where a subclass derives from a parent class.
- "Has-a" relationship with exclusive ownership : This describes Composition , where the contained objects' lifecycle is tied to the container.
- Parent-child relationship : This typically relates to Inheritance or tree structures , not Aggregation.
- Object-to-object message communication : This aligns with Message Passing , which focuses on interaction between objects rather than relationships
First Auditor of a company is appointed by the ________________________
Which of the following inventory methods would reduce tax liability during inflationary period?
Preference shareholders can vote on all the resolutions placed before the company if________________
A trader crosses the threshold limit for GST registration in June. He registers on July 10. He raises a taxable invoice on July 5. Is GST applicable?
Mr. X, an Indian citizen, stayed in India for 130 days during FY 2024-25. In the four preceding years, his total stay in India was 480 days. Determine h...
Taxable person means a person who isÂ
An employee receives gratuity of ₹12 lakhs on retirement. What is the maximum tax-exempt amount under the Income Tax Act?
The remuneration of the auditor of a company shall be ________________________
Schedule II in the context of Goods and Service Tax deals with?
The books of account of every company relating to a period of __________________ immediately preceding a financial year together with the vouchers rele...