Listlist=//morecodehere12.Collections.sort(list,newMyComparator());Whichcodewillsortthislistintheoppositeorderofthesortinline12?()A.Collections.reverseSort(list,newMyComparator());B.Collections.sort(list,newMyComparator());list.reverse();C.Collections.sor

题目
Listlist=//morecodehere12.Collections.sort(list,newMyComparator());Whichcodewillsortthislistintheoppositeorderofthesortinline12?()

A.Collections.reverseSort(list,newMyComparator());

B.Collections.sort(list,newMyComparator());list.reverse();

C.Collections.sort(list,newInverseComparator(newMyComparator()));

D.Collections.sort(list,Collections.reverseOrder(newMyComparator()));


相似考题
参考答案和解析
参考答案:D
更多“Listlist=//morecodehere12.Collections.sort(list,newMyComparator());Whichcodewillsortthislistintheoppositeorderofthesortinline12?() ”相关问题
  • 第1题:

    定义一个List对象list,使用ArrayList的构造方法进行初始化,并且要求list中必须全部存放Integer类型的对象,以下语句正确的是()。

    A.List list = new ArrayList<Integer>();

    B.List list = new ArrayList ();

    C.List<Integer> list = new ArrayList<Integer>();

    D.ArrayList<Integer> list = new List<Integer>();


    List list = new ArrayList ();

  • 第2题:

    定义一个List对象list,使用ArrayList的构造方法进行初始化,并且要求list中必须全部存放Integer类型的对象,以下语句正确的是()。

    A.List list = new ArrayList ();

    B.List list = new ArrayList<Integer>();

    C.ArrayList<Integer> list = new List<Integer>();

    D.List<Integer> list = new ArrayList<Integer>();


    List list = new ArrayList ();

  • 第3题:

    定义一个List对象list,使用ArrayList的构造方法进行初始化,并且要求list中必须全部存放Integer类型的对象,以下语句正确的是()。

    A.List list = new ArrayList ();

    B.List list = new ArrayList<Integer>();

    C.List<Integer> list = new ArrayList<Integer>();

    D.ArrayList<Integer> list = new List<Integer>();


    A

  • 第4题:

    5. 给定如下Java代码,可以填入横线处的代码是() public static void main(String[] args) { ________ list.addLast("001"); }

    A.List list = new ArrayList();

    B.List list = new List();

    C.ArrayList list = new ArrayList();

    D.LinkedList list = new LinkedList();


    AB

  • 第5题:

    现在需要对list类对象使用的逻辑运算符==重载,以下函数声明正确的是?

    A.list &list::operator==(const list &a);

    B.list list::operator==(const list &a);

    C.bool &list::operator==(const list &a);

    D.bool list::operator==(const list &a);


    $