Не видит human father, хотя все написано, объясните пожалуйста что не так!
package com.javarush.task.task07.task0724;
/*
Семейная перепись
*/
public class Solution {
public static void main(String[] args) {
// напишите тут ваш код
Human h1 = new Human("Лара",false,13);
Human h2 = new Human("Максим",true,12);
Human h3 = new Human("Лара",false,23);
Human h4 = new Human("Леха",true,21);
Human h5 = new Human("Ангелина",false,32,sasha,olga);
Human h6 = new Human("Антон",true,14,sergey,nina);
Human h7 = new Human("Елизавета",false,15,anton,elena);
Human h8 = new Human("Вася",true,12,Andrey,zina);
Human h9 = new Human("Еживика",false,16,alex,ulia);
}
public static class Human {
// напишите тут ваш код
String name;
boolean sex;
int age;
Human mother;
Human father;
public Human(String name, boolean sex, int age){
this.name = name;
this.sex = sex;
this.age = age;
}
public Human(String name, boolean sex, int age,Human father, Human mother){
this.name = name;
this.sex = sex;
this.age = age;
this.father = father;
this.mother = mother;
}
public String toString() {
String text = "";
text += "Имя: " + this.name;
text += ", пол: " + (this.sex ? "мужской" : "женский");
text += ", возраст: " + this.age;
if (this.father != null) {
text += ", отец: " + this.father.name;
}
if (this.mother != null) {
text += ", мать: " + this.mother.name;
}
return text;
}
}
}