-
Notifications
You must be signed in to change notification settings - Fork 63
Первый проект! #22
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?
Первый проект! #22
Conversation
| boolean hasPerson = false; | ||
| for(Human h : familyList) { | ||
| if(h.getName().equalsIgnoreCase(name) && h.getSurname().equalsIgnoreCase(surname)) { | ||
| System.out.println(h); |
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.
Старайтесь писать методы, которые возвращают результат своей работы, а не выводят в консоль
| Gender gender; | ||
| List<Human> children; | ||
| Human father, mother; |
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
| * @param day - день рождения человека | ||
| * @param gender - пол человека | ||
| */ | ||
| Human(String name, String surname, int year, int month,int day,Gender gender){ |
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, String surname, int year, int month,int day,int year2, int month2, int day2,Gender gender){ | ||
| this.name = name; | ||
| this.surname = surname; | ||
| this.dob = LocalDate.of(year, month, day); | ||
| this.dod = LocalDate.of(year2, month2, day2); | ||
| this.gender = gender; | ||
| children = new ArrayList<>(); | ||
| } |
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.
нарушение принципа DRY
| public void showChildren() { | ||
| boolean hasChildren = false; | ||
| for(Human h : children) { | ||
| System.out.println(h); |
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.
Возвращаем результат
No description provided.