Computer Science, asked by vibhanshushavarna, 1 year ago

Consider the following sentence: “Students live in hostels”. From an analysis of the sentence, identify the relation between the two classes Student and Hostel that can be inferred from the sentence.
a. Inheritance
b. Association
c. Aggregation
d. Composition

Answers

Answered by allaavinash2002
2

Answer:

Association

Explanation:

Because they are sharing the same room

Answered by qwcricket10
0

Option(b) Association is the relationship that exists between the two classes student and hostel.

  • How two classes are connected can be identified by looking into their relationship.
  • When some properties of one class are taken by another class then that type of relationship is termed inheritance.
  • But in aggregation relation no dependencies are there, any update on one class will not affect the other class.
  • In the composition there is thick bonding between the two classes, one can not stand without the other class.
  • The relationship that exists between individuals and an organization can be represented using association relations, as this type of relation shows the connection between the two and how they make use of each other.
Similar questions