Given:
1. class One{
2. public One foo(){return this;}
3. }
4. class Two extends One{
5. public One foo(){return this;}
6. }
7. class Three extends Two{
8. //insert method here
9. }
Which two methods, inserted individually, correctly complete the Three class? (Choose two.)
A. public void foo(){}
B. public int foo(){return 3;}
C. public Two foo(){return this;}
D. public One foo(){return this;}
E. public Object foo(){return this;}
答案:CD
继承题
最新推荐文章于 2022-10-04 17:47:14 发布