欢迎来到易学考试网 易学考试官网
全部科目 > Java认证考试 > SCJP程序员认证考试

单项选择题

23. Object [] myObjects = { 
24. new integer(12), 
25. new String(”foo”), 
26. new integer(5), 
27. new Boolean(true) 
28. }; 
29. Arrays.sort(myObjects); 
30. for( int i=0; i31. System.out.print(myObjects[i].toString()); 
32. System.out.print(” “); 
33. } 
What is the result?() 

 

    A. Compilation fails due to an error in line 23.
    B. Compilation fails due to an error in line 29.
    C. A ClassCastException occurs in line 29.
    D. A ClassCastException occurs in line 31.
    E. The value of all four objects prints in natural order.

点击查看答案&解析

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题