black

SCJP程序员认证考试

登录

单项选择题

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?()

A.0
B.1
C.a
D.b
E.c
F.The result is undefined.

相关考题

单项选择题 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?()

单项选择题 public class Drink implements Comparable {  public String name;  public int compareTo(Object o) {  return 0;  }  }  and:  Drink one = new Drink();  Drink two = new Drink();  one.name= “Coffee”;  two.name= “Tea”;  TreeSet set = new TreeSet();  set.add(one);  set.add(two);  A programmer iterates over the TreeSet and prints the name of each Drink object. What is the result?()

All Rights Reserved 版权所有©求知题库网库(csqiuzhi.com)

备案号:湘ICP备14005140号-1

经营许可证号:湘B2-20140064