問題詳情

第38題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 here9. }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;}

參考答案

答案:C,D
難度:適中0.428571
統計:A(17),B(10),C(73),D(71),E(10)