12.2k views
1 vote
Which type of relationship is depicted between the "building" and "school" classes in the following code snippet?

a) Public class
b) Private class
c) No relationship between the two classes
d) Inheritance relationship

User Komsomol
by
7.8k points

1 Answer

3 votes

There is c) No relationship between the two classes

How to get the relationship between classes

Based on object-oriented programming principles: If there is no indication of inheritance, composition, or any other direct relationship (like aggregation), it's most likely that there's no explicit relationship established between the "building" and "school" classes in the given context.

Hence we would say that c) No relationship between the two classes given that the code snippet was not shared.

User Anil Bharadia
by
8.3k points