可学答题网 > 问答 > SCJP程序员认证考试题库
目录: 标题| 题干| 答案| 搜索| 相关
问题

public static Iterator&ensp


public static Iterator reverse(List list) {  Collections.reverse(list);  return list.iterator();  }  public static void main(String[] args) {  List list = new ArrayList();  list.add(” 1”); list.add(”2”); list.add(”3”);  for (Object obj: reverse(list))  System.out.print(obj + “,”);  }  What is the result?() 

  • A 3,2,1,
  • B 1,2,3,
  • C Compilation fails.
  • D The code runs with no output.
  • E An exception is thrown at runtime.
参考答案
参考解析:
分类:SCJP程序员认证考试题库
相关推荐

1、public static void mai

public static void main(String[] args) { String str = null‟; if (str == null) {&ensp...

2、public static void par

public static void parse(String str) { try { float f= Float.parseFloat(str); } catch (NumberFo...

3、11. public static void

11. public static void main(String[] args) { 12. Integer i = uew Integer(1) + new Inte...

4、11. public static void

11. public static void test(String str) { 12. if(str == null  str.lellgth() == 0) {&...

5、表达式10>5&&6%3的值是()

表达式10>5&&6%3的值是()A-1B非零值C0D1

6、public static void tes

public static void test(String str) {int check = 4; if (check = str.length()) { System.o...