Can somebody please get me out of this painful misery. I am stuck and I do not know what is causing this compiler error:<identifier> expected @ line 53
Thank you for your inputs.
package com.codegym.task.task07.task0724;
/*
Family census
*/
public class Solution {
public static void main(String[] args) {
// write your code here
Human grandFather1 = new Human("Dodoo", true, 78);
Human grandMother1 = new Human("Ayele", false, 75);
Human grandFather2 = new Human("Sowa Tetteh", true, 75);
Human grandMother2 = new Human("Anye", false, 70);
Human myFather = new Human("Lan Tei", true, 52, grandFather2, grandMother2);
Human myMother = new Human("Koshie", false, 50, grandFther1, grandMother1);
Human child1 = new Human("Leroy", true, 40, myFther, myMother);
Human child2 = new Human("Ayishetu", false, 30, myFather, myMother);
Human child3 = new Human("Ramatu", false, 27, myFather, myMother);
grandFather1.toString();
grandMother1.toString();
grandFather2.toString();
grandMother2.toString();
myFather.toString();
myMother.toString();
child1.toString();
child2.toString();
child3.toString();
}
public static class Human {
// write your code here
String name;
boolean sex;
int age;
Human father;
Human mother;
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 papa,Human mama){
this.name = name;
this.sex = sex;
this.age = age;
this.father = papa;
this.mother = mama;
} I
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;
}
}
}