-
Notifications
You must be signed in to change notification settings - Fork 63
Попытка раз. Требуется помощь. #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| import java.util.ArrayList; | ||
| import java.util.List; | ||
|
|
||
| public class Family extends Human{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Семья и человек это очевидно не одно и тоже. Наследование ошибочно. Например у Семьи нет пола или возраста, а у человека есть
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Возможно неудачно выбрано имя класса
| private Human father, mother; | ||
| private List<Human> parents; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не понял. Отдельно папа и мама и отдельно список родителей? Это не одно и тоже?
|
|
||
| public Human(String name, Gender gender, LocalDate birthDate) { | ||
| id = -1; | ||
| this.name = name.toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
зачем toString? name и так является стрингом
| import java.time.LocalDate; | ||
|
|
||
| public class Main { | ||
| public static void main(String[] args) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не показано создание родственных связей
Предполагал сделать отдельно создание человек, отдельно создание семьи. А после образования семьи уже создание древа семьи, но что-то пошло не так.
Прошу помощи.