Java面试题求解# JobHunting - 待字闺中
b*f
1 楼
Java 小白,实在不知道怎么做。求大侠解答!下周就要去面试了,不是Java
developer的职位,但是会考到一点编程。
public class Person {
Person father;
Person mother;
Gender gender;
Integer age;
List children;
int level = 0;
public enum Gender {
Male,
Female;
}
}
For the above class, you basically have to implement 2 methods.
public List getOldestSisters()
(person can have multiple parents since remarrying )
public List getGreatestAncestors()
Find the oldest sisters of the given Person object. Such class recursively
defines a Person father, Person mother, and a List of children
developer的职位,但是会考到一点编程。
public class Person {
Person father;
Person mother;
Gender gender;
Integer age;
List
int level = 0;
public enum Gender {
Male,
Female;
}
}
For the above class, you basically have to implement 2 methods.
public List
(person can have multiple parents since remarrying )
public List
Find the oldest sisters of the given Person object. Such class recursively
defines a Person father, Person mother, and a List