试题详情
- 多项选择题 ArraryList a = new ArrayList(); a.add(“Alpha”); a.add(“Bravo”): a.add(“Charlie”); a.add(“Delta”); Iterator iter = a.iterator(); Which two, added at line 17, print the names in the ArrayList in alphabetical order?()
A、 for (int i=0; i< a.size(); i++) System.out.println(a.get(i)));
B、 for (int i=0; i< a.size(); i++) System.out.println(a[i]);
C、 while( iter.hasNext() ) System.out.println(iter.next()) ;
D、 for (int i=0, i< a.size(); i++) System.out.println(iter[i]);
E、 for (int i=0; i< a.size(); i++) System.out.println(iter.get(i));
- A,C
关注下方微信公众号,在线模考后查看
热门试题