单选题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?()A Collections.reverseSort(list, new MyComparator());B Collections.sort(list, new MyComparator()); list.reverse();C Collections.sort(list, new InverseComparator( new MyComparator()));D Collections.sort(list, Collections.reverseOrder( new MyComparator()));

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

 Collections.reverseSort(list, new MyComparator());

B

 Collections.sort(list, new MyComparator()); list.reverse();

C

 Collections.sort(list, new InverseComparator( new MyComparator()));

D

 Collections.sort(list, Collections.reverseOrder( new MyComparator()));


参考解析

解析: 暂无解析

相关考题:

与List1.Text属性值相同的是( )。A.List1.ListCountB.List1.List(ListCount-1)C.List1.ListIndexD.List1.List(List.ListIndex)

1.importjava.util.*;2.classForInTest{3.staticListlist=newArrayList();4.5.staticListgetList(){returnlist;}6.7.publicstaticvoidmain(String[]args){8.list.add(a);list.add(b);list.add(c);9.//insertcodehere10.System.out.print(o);11.}12.}第9行插入哪一项将输出abc?()A.for(charo:list)B.for(Objecto:getList())C.for(Objecto:getList();)D.for(Objecto:o.getList())

3.importjava.util.*;4.classForInTest{5.staticListlist=newArrayList();6.7.publicstaticvoidmain(String[]args){8.list.add(a);list.add(b);list.add(c);9.//insertcodehere10.System.out.print(o);11.}12.}哪一行插入到第9行将导致输出abc”?()A.for(Objecto:list)B.for(Iteratoro:list)C.for(Objecto:list.iterator())D.for(Iteratoro:list.iterator();o.hasNext();)

现有:1.importjava.util.*; 现有:1.importjava.util.*;2.classForInTest{3.staticListlist-newArrayList():4.5.staticListgetList(){returnlist;}6.7.publicstaticvoidmain(Strincj[]args){8.list.add(a);list.add(b);list.add(c);9.//insertcodehere10.System.out.print(o);11.}12.}第9行插入哪一项将输出abc?()

引用列表框(List1)最后一个数据项应使用的语句是()。 A、List1.List(List1.ListCount)B、List1.List(List1.ListCount-1)C、List1.List(ListCount)D、List1.List(ListCount-1)

helga is working with a multi-value field that has numeric values in a list. she would like to apply a formula to each item in the list, return the list which one of the following @fuctions can she use to accomplish this with one line of code?()A、@transform  B、@Listprocess  C、@processlist D、@listevaluate

现有:   3.import java.util.*;   4.class ForInTest {   5.static List list = new ArrayList();  6.public static void main (String [] args){   7.  8.list.add("a"); list.add("b"); list.add("c");   9.//insert code here      10.System.out.print(o);  } }   哪一行插入到第9行将导致输出“abc”?() A、 for(Object o : list)B、 for(Iterator o : list)C、 for(Object o : list.iterator())D、 for(Iterator o : list.iterator(); o.hasNext (); )

11. public void addStrings(List list) {  12. list.add(”foo”);  13. list.add(”bar”);  14. }  What must you change in this method to compile without warnings?() A、 add this code after line 11: list = (List) list;B、 change lines 12 and 13 to: list.add(”foo”); list.add(”bar”);C、 change the method signature on line 11 to: public void addStrings(List extends String list) {D、 change the method signature on line 11 to: public void addStrings(List super String list) {E、 No changes are necessary. This method compiles without warnings.

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?() A、 Collections.reverseSort(list, new MyComparator());B、 Collections.sort(list, new MyComparator()); list.reverse();C、 Collections.sort(list, new InverseComparator( new MyComparator()));D、 Collections.sort(list, Collections.reverseOrder( new MyComparator()));

You are writing a JSP that includes scriptlet code to declare a List variable and initializes that variable to anArrayList object. Which two JSP code snippets can you use to import these list types?()A、%! import java.util.*; %B、%! import java.util.List;import java.util.ArrayList; %C、%@ page import=’java.util.List’import=’java.util.ArrayList’ %D、%@ import types=’java.util.List’types=’java.util.ArrayList’ %E、%@ page import=’java.util.List,java.util.ArrayList’ %F、%@ import types=’java.util.List,java.util.ArrayList’ %

引用列表框List1最后一个数据项应使用()。A、List1.List(List1.ListCount)B、List1.List(List1.ListCount-1)C、List1.List(ListCount)D、List1.List(ListCount-1)

引用列表框的最后一项应使用()。A、List1.List(List1.ListCount-1)B、List1.List(List1.ListCount)C、List1.List(ListCount)D、List1.List(ListCount-1)

1. import java.util.*;  2. class ForInTest {  3. static List list = new ArrayList();  4.  5. static List getList() { return list; }  6.  7. public static void main(String [] args) {  8. list.add("a"); list.add("b"); list.add("c");  9. // insert code here  10. System.out.print(o);  11. }  12. } 第 9 行插入哪一项将输出 abc?() A、for(char o: list)B、for(Object o: getList())C、for(Object o: getList();)D、for(Object o: o.getList())

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.

11. public static void append(List list) { list.add(”0042”); }  12. public static void main(String[] args) {  13. List intList = new ArrayList();  14. append(intList);  15. System.out.println(intList.get(0));  16. }  What is the result?() A、 42B、 0042C、 An exception is thrown at runtime.D、 Compilation fails because of an error in line 13.E、 Compilation fails because of an error in line 14.

单选题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.

多选题View the Exhibit and examine the data in the PRODUCT INFORMATION table. Which two tasks would require subqueries? ()Adisplaying the minimum list price for each product statusBdisplaying all supplier IDs whose average list price is more than 500Cdisplaying the number of products whose list prices are more than the average list priceDdisplaying all the products whose minimum list prices are more than the average list price of products having the product status orderableEdisplaying the total number of products supplied by supplier 102071 and having product status OBSOLETE

多选题Given:   10. class One {   11. void foo() { }   12. }   13. class Two extends One {   14. //insert method here   15. }   Which three methods, inserted individually at line 14, will correctly complete class Two?()Apublic void foo() { /* more code here */ }Bprivate void foo() { /* more code here */ }Cprotected void foo() { /* more code here */ }Dint foo() { /* more code here */ }Evoid foo() { /* more code here */ }

单选题11. public void addStrings(List list) {  12. list.add(”foo”);  13. list.add(”bar”);  14. }  What must you change in this method to compile without warnings?()A add this code after line 11: list = (List) list;B change lines 12 and 13 to: list.add(”foo”); list.add(”bar”);C change the method signature on line 11 to: public void addStrings(List extends String list) {D change the method signature on line 11 to: public void addStrings(List super String list) {E No changes are necessary. This method compiles without warnings.

单选题10. interface A { void x(); }  11. class B implements A { public void x() { } public voidy() { } }  12. class C extends B { public void x() {} }  And:  20. java.util.List list = new java.util.ArrayList();  21. list.add(new B());  22. list.add(new C());  23. for (A a:list) {  24. a.x();  25. a.y();;  26. }  What is the result?()A The code runs with no output.B An exception is thrown at runtime.C Compilation fails because of an error in line 20.D Compilation fails because of an error in line 21.E Compilation fails because of an error in line 23.F Compilation fails because of an error in line 25.

单选题In a JSP-centric web application, you need to create a catalog browsing JSP page. The catalog is stored asa List object in the catalog attribute of the webapp’s ServletContext object.  Which scriptlet code snippetgives you access to the catalog object?()A% List catalog = config.getAttribute(catalog); %B% List catalog = context.getAttribute(catalog); %C% List catalog = application.getAttribute(catalog); %D% List catalog = servletContext.getAttribute(catalog); %

单选题现有:   3.  import java.util.*;   4.  class ForInTest {   5.    static List list = new ArrayList();   6.   7.    public static void main(String [] args) {   8.      list.add("a"); list.add("b"); list.add("c");   9.      //insert code here      10.     System.out.print(o);    11.   }   12. }   哪一行插入到第9行将导致输出“abc”?()A for(Object o : list)B for(Iterator o : list)C for(Object o : list.iterator())D for(Iterator o : list.iterator(); o.hasNext (); )

单选题现有:   3.import java.util.*;   4.class ForInTest {   5.static List list = new ArrayList();  6.public static void main (String [] args){   7.  8.list.add("a"); list.add("b"); list.add("c");   9.//insert code here      10.System.out.print(o);  } }   哪一行插入到第9行将导致输出“abc”?()A for(Object o : list)B for(Iterator o : list)C for(Object o : list.iterator())D for(Iterator o : list.iterator(); o.hasNext (); )

单选题3. import java.util.*;   4. class ForInTest {   5. static List list = new ArrayList();   6.   7. public static void main(String [] args) {   8. list.add("a"); list.add("b"); list.add("c");   9. //insert code here   10. System.out.print(o);   11. }   12. }   哪一行插入到第9行将导致输出“abc”?()A for(Object o : list)B for(Iterator o : list)C for(Object o : list.iterator())D for(Iterator o : list.iterator(); o.hasNext (); )

单选题1. import java.util.*;  2. class ForInTest {  3. static List list = new ArrayList();  4.  5. static List getList() { return list; }  6.  7. public static void main(String [] args) {  8. list.add("a"); list.add("b"); list.add("c");  9. // insert code here  10. System.out.print(o);  11. }  12. } 第 9 行插入哪一项将输出 abc?()Afor(char o: list)Bfor(Object o: getList())Cfor(Object o: getList();)Dfor(Object o: o.getList())

多选题You are writing a JSP that includes scriptlet code to declare a List variable and initializes that variable to anArrayList object. Which two JSP code snippets can you use to import these list types?()A%! import java.util.*; %B%! import java.util.List;import java.util.ArrayList; %C%@ page import=’java.util.List’import=’java.util.ArrayList’ %D%@ import types=’java.util.List’types=’java.util.ArrayList’ %E%@ page import=’java.util.List,java.util.ArrayList’ %F%@ import types=’java.util.List,java.util.ArrayList’ %

多选题10. class Foo {  11. static void alpha() { /* more code here */ }  12. void beta() { /* more code here */ }  13. }  Which two are true?()AFoo.beta() is a valid invocation of beta().BFoo.alpha() is a valid invocation of alpha().CMethod beta() can directly call method alpha().DMethod alpha() can directly call method beta().