注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
Java 小白,实在不知道怎么做。求大侠解答!
public class Person { Person father; Person mother; Gender gender; Integer age; List<Person> children;
int level = 0;
public enum Gender { Male, Female; } } For the above class, you basically have to implement 2 methods. public List<Person> getOldestSisters() (person can have multiple parents since remarrying ) public List<Person> getGreatestAncestors()
Find the oldest sisters of the given Person object. Such class recursively defines a Person father, Person mother, and a List<Person> of children
|