标签:工具 rate method oid sort add reverse system string
参考:
http://www.cnblogs.com/nayitian/p/3269585.html
public static void main(String[] args) {
// TODO Auto-generated method stub
List<Integer> pokerList = new ArrayList<Integer>();
pokerList.add(13);
pokerList.add(14);
pokerList.add(3);
System.out.println("远顺序:" + pokerList);
//1) 排序(由小到大)
//Collections.sort(pokerList);
//System.out.println("sort后顺序:" + pokerList);
//2)倒置/反转
//Collections.reverse(pokerList);
//System.out.println("reverse后顺序:" + pokerList);
//3)排序(由大到小)
//Collections.sort(pokerList,Collections.reverseOrder());
//System.out.println("由大到小排序:" + pokerList);
//3)排序(由大到小)
Collections.sort(pokerList); //先 由小岛大
Collections.reverse(pokerList); //再 反转
System.out.println("由大到小排序:" + pokerList);
}
标签:工具 rate method oid sort add reverse system string
原文地址:http://www.cnblogs.com/greenZ/p/7044138.html