help me to resolve it, please
package com.codegym.task.task07.task0724;
/*
Family census
*/
public class Solution {
public static void main(String[] args) {
// write your code here
Human Papa = new Human("papa",true,50);
Human Mummy = new Human("mummy",false,50);
Human h1 = new Human("Pragati",false, 22);
Human h2 = new Human("Pragati1",false, 21);
Human h3 = new Human("Pragati2",false, 23);
Human h4 = new Human("Pragati3",false, 24);
Human h5 = new Human("Pragati4",false, 25,Papa,Mummy);
Human h6 = new Human("Pragati5",false, 26,Papa,Mummy);
Human h7 = new Human("Pragati6",false, 27,Papa,Mummy);
Human h8 = new Human("Pragati7",false, 28,Papa,Mummy);
Human h9 = new Human("Pragati8",false, 29,Papa,Mummy);
System.out.println(h1);
System.out.println(h2);
System.out.println(h3);
System.out.println(h4);
System.out.println(h5.toString());
System.out.println(h6.toString());
System.out.println(h7.toString());
System.out.println(h8.toString());
System.out.println(h9.toString());
}
public static class Human {
// write your code here
String name;
boolean sex;
int age;
static Human father;
static Human mother;
Human(String name, boolean sex, int age)
{
this.name=name;
this.sex=sex;
this.age=age;
}
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 += "Name: " + this.name;
text += ", sex: " + (this.sex ? "male" : "female");
text += ", age: " + this.age;
if (this.father != null)
text += ", father: " + this.father.name;
if (this.mother != null)
text += ", mother: " + this.mother.name;
return text;
}
}
}