S
S
Sergey Sergey2022-04-21 16:49:07
Java
Sergey Sergey, 2022-04-21 16:49:07

Relationship between Student (is-a) Person and relationship Group (has-a) Student?

public class Student extends Person{ 
Group group;
}

public class Group{ 
Student student;
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
Jacen11, 2022-04-21
@Jacen11

Yes

public class Student{
Group group;
}
just what the hell is this, why are there two Student classes

O
Orkhan, 2022-04-21
Hasanly @azerphoenix

Good afternoon.
Student is a Person is an association.
Group has a Person is an aggregation. It is not a composition, since a student can exist separately from the group.
https://habr.com/ru/post/150041/
https://javarush.ru/groups/posts/1967-otnoshenija-...
https://habr.com/ru/post/511798/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question