13.9k views
5 votes
Which of the following statements best describes OWNS-A association relationship? A reference type X that contains another reference type Y A reference type X that extends another reference type Y A reference type X that has another reference type Y as an instance variable None of the above

User WWJD
by
7.4k points

1 Answer

2 votes

Final answer:

An OWNS-A association relationship is when a reference type X has another reference type Y as an instance variable, signifying that one object contains or 'owns' another as part of its state.

Step-by-step explanation:

The statement that best describes an OWNS-A association relationship is 'A reference type X that has another reference type Y as an instance variable'.

This means that within the class or structure of type X, there is a field or property that holds a reference to an instance of type Y. Contrary to inheritance, where a class extends the properties and behaviors of another class, an OWNS-A relationship implies composition or aggregation where one object 'owns' or 'contains' another object as part of its state.

User Jquestions
by
8.0k points