欢迎来到牛牛题库网 牛牛题库官网
logo

单项选择题

有下列一段代码,执行后输出结果为。
public class SortOf{
   public static void main(String[]args){
     ArrayList a = new ArrayList();
     a.add(1);
     a.add(5);
     a.add(3);
     Collections.sort(a);
     a.add(2);
     Collections.reverse(a);
     System.out.println(a);
   }
} A.
 [1, 2, 3, 5] B.
 [2, 1,3, 5] C.
 [2, 5, 3, 1] D.
[1, 3, 5, 2]

点击查看答案&解析
微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题