String[] sArray = new String[]{"z","a",C"};
List list = Array.aslist(sArray);
Collection.sort(list);//结果为C a z
Collection.sort(list,String.CASE_INSENSITIVE_ORDER);//结果为a C z
Collection.sort(list,Collections.reverseOrder());//z,a,C
Collection.sort(list,String.CASE_INSENSITIVE_ORDER);
Collection.reverse(list);//z,C,a
2009-07-23
java ArrayList Sorting type
訂閱:
發佈留言 (Atom)
0 留言:
發佈留言