public static void main(String args[]) { ArrayList list = new ArrayList(); for (int i = 0; i < 10; i++) { list.add((int) (Math.random() * 100)); } Collections.sort(list); System.out.println(Arrays.toString(list.toArray())); }
源码呢? 这就是个集合而已啊