I am blocked. I do not know how to recognize the first names of fathers and mothers. could you help me?
package fr.codegym.task.task07.task0724;
/*
Arbre généalogique
*/
public class Solution {
public static void main(String[] args) {
Humain humain = new Humain ("Kate", false, 55); // écris ton code ici
Humain humain2 = new Humain ("Paul", true, 56);
Humain humain3 = new Humain ("Valérie", false, 62); // écris ton code ici
Humain Humain4 = new Humain ("Jonas", true, 67);
Humain humain5 = new Humain ("Anna", false, 21, Humain "Paul" , "Kate"); // écris ton code ici
Humain Humain6 = new Humain (" Michael", true, 25, "Jonas", "Valérie");
Humain humain7 = new Humain ("Louise", false, 3, "Michael", "Anna"); // écris ton code ici
Humain Humain8 = new Humain ("Ben", true, 2, "Michael", "Anna");
Humain humain9 = new Humain ("Kelly", false, 1, "Michael", "Anna"); // écris ton code ici
}
public static class Humain {
String nom;
boolean sexe;
int age;
Humain pere = nom;
Humain mere = nom;
public Humain (String nom, boolean sexe, int age){
this.nom = nom;
this.sexe = sexe;
this.age = age;
}
public Humain (String nom, boolean sexe, int age, Humain pere, Humain mere){
this.nom = nom;
this.sexe = sexe;
this.age = age;
this.pere = pere.nom;
this.mere = mere.nom;
}
// écris ton code ici
public String toString() {
String texte = "";
texte += "Nom : " + this.nom;
texte += ", sexe : " + (this.sexe ? "masculin" : "féminin");
texte += ", âge : " + this.age;
if (this.pere != null)
texte += ", père : " + this.pere.nom;
if (this.mere != null)
texte += ", mère : " + this.mere.nom;
return texte;
}
}
}