i think i cant
package zh.codegym.task.task07.task0724;
/*
家庭人口普查
*/
public class Solution {
public static void main(String[] args) {
// 在此编写你的代码
}
public static class Human {
// 在此编写你的代码
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;
}
}
}