問題詳情

第13題Given:1. public class Barn{2. public static void main(String[] args){private void bar(int x){}public void bar(int x){}public int bar(String x){return 1;}public Alpha bar(int x){}public void bar(int x, int y){}public int bar(int x){return x;}MethodsSCJP 6.0 認證教戰手冊 黃彬華著 碁峰出版73. new Barn.go("hi", 1);4. new Barn.go("hi", "world", 2);5. }6. public void go(String... y, int x){7. System.out.print(y[y.length-1] + " ");8. }9. }What is the result?
(A) hi hi
(B) hi world
(C) world world
(D) Compilation fails.
(E) An exception is thrown at runtime.

參考答案

答案:D
難度:簡單0.803279
統計:A(4),B(15),C(10),D(147),E(4)