black

SCJP程序员认证考试

登录

单项选择题

import java.util.*; 
public class LetterASort { 
public static void main(String[] args) { 
ArrayList strings = new ArrayList(); 
strings.add(‟aAaA”); 
strings.add(”AaA”);
strings.add(‟aAa”); 
strings.add(”AAaa”); 
Collections.sort(strings); 
for (String s: strings) { System.out.print(s + “ “); } 
} 
} 
What is the result?() 

A. Compilation fails.
B. aAaA aAa AAaa AaA
C. AAaa AaA aAa aAaA
D. AaA AAaa aAaA aAa
E. aAa AaA aAaA AAaa
F. An exception is thrown at runtime.

相关考题

单项选择题 public static void search(List list) {  list.clear();  list.add(”b”);  list.add(”a”);  list.add(”c”);  System.out.println(Collections.binarySearch(list, “a”));  }  What is the result of calling search with a valid List implementation?()

单项选择题 Given:  int[] myArray=newint[] {1, 2,3,4, 5};  What allows you to create a list from this array?()

单项选择题 11. List list = // more code here  12. Collections.sort(list, new MyComparator());  Which code will sort this list in the opposite order of the sort in line 12?()

All Rights Reserved 版权所有©考试题库网(kstiku.com)

备案号:湘ICP备14005140号-3

经营许可证号:湘B2-20140064