на строчке 72 и 38 ошибка. что не так....помогитеее
package com.javarush.task.task08.task0824;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/*
Собираем семейство
*/
public class Solution {
public static void main(String[] args) {
Human Sınİrı = new Human();
Human SınVasa = new Human();
Human SınNastya = new Human();
ArrayList<Human> İraSın = new ArrayList<>();
İraSın.add(Sınİrı);
ArrayList<Human> VasaSın = new ArrayList<>();
VasaSın.add(SınVasa);
ArrayList<Human> NastyaSın = new ArrayList<>();
NastyaSın.add(SınNastya);
Human İra = new Human("İra",13,false,İraSın);
Human Vasa = new Human("Vasa",14,true,VasaSın);
Human Nastya = new Human("Nastya",17,false,NastyaSın);
ArrayList<Human> children = new ArrayList<>();
children.add(İra);
children.add(Vasa);
children.add(Nastya);
Human father = new Human("Petr",47,true,children);
Human mother = new Human("Masha",43,false,children);
//напишите тут ваш код
ArrayList<Human> children_grandfather_and_grandmother_to_father = new ArrayList<>();
children_grandfather_and_grandmother_to_father.add(father);
ArrayList<Human> children_grandfather_and_grandmother_to_mother = new ArrayList<>();
children_grandfather_and_grandmother_to_mother.add(mother);
Human grandfather_from_mother = new Human("Ivan",75,true,children_grandfather_and_grandmother_to_mother);
Human grandfather_from_father = new Human("Vasya",77,true,children_grandfather_and_grandmother_to_father);
Human grandmother_from_mother = new Human("Masha",69,false,children_grandfather_and_grandmother_to_mother);
Human grandmother_from_father = new Human("Nastya",69,false,children_grandfather_and_grandmother_to_father);
System.out.println(İra.toString()+Vasa.toString()+Nastya.toString()+father.toString()+mother.toString()+grandfather_from_mother.toString()+grandfather_from_father.toString()+grandmother_from_mother.toString()+grandmother_from_father.toString());
}
public static class Human {
String name;
int age;
boolean sex;
ArrayList<Human> children;
Human (String name,int age,boolean sex,ArrayList<Human> children) {
this.name = name;
this.age = age;
this.sex = sex;
this.children = children;
}
Human () {
}
//напишите тут ваш код
public String toString() {
String text = "";
text += "Имя: " + this.name;
text += ", пол: " + (this.sex ? "мужской" : "женский");
text += ", возраст: " + this.age;
int childCount = this.children.size();
if (childCount > 0) {
text += ", дети: " + this.children.get(0).name;
for (int i = 1; i < childCount; i++) {
Human child = this.children.get(i);
text += ", " + child.name;
}
}
return text;
}
}
}