Here you can find the source of sortListStingArrayByFirstDes( List
public static List<String[]> sortListStingArrayByFirstDes( List<String[]> list)
//package com.java2s; //License from project: Apache License import java.util.Collections; import java.util.Comparator; import java.util.List; public class Main { public static List<String[]> sortListStingArrayByFirstDes( List<String[]> list) { Comparator<String[]> com = new Comparator<String[]>() { public int compare(String[] o1, String[] o2) { double num1 = Double.valueOf(o1[0] == null ? "0" : o1[0]); double num2 = Double.valueOf(o2[0] == null ? "0" : o2[0]); if (num2 < num1) { return 1; } else if (num2 > num1) { return -1; } else { return 0; }//from w ww .ja v a2 s .c o m } }; Collections.sort(list, com); return list; } }