Skip to content

Conversation

@leshaVoronyuk00
Copy link

No description provided.

boolean hasPerson = false;
for(Human h : familyList) {
if(h.getName().equalsIgnoreCase(name) && h.getSurname().equalsIgnoreCase(surname)) {
System.out.println(h);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Старайтесь писать методы, которые возвращают результат своей работы, а не выводят в консоль

Comment on lines 15 to 17
Gender gender;
List<Human> children;
Human father, mother;
Copy link
Owner

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){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public

Comment on lines 46 to 53
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<>();
}
Copy link
Owner

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);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Возвращаем результат

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants