List 中对象排序通用方法

    Collections.sort(list, new Comparator() { 
              public int compare(Object a, Object b) { 
                int one = ((Order)a).getUserId (); 
                int two = ((Order)b).getUserId ();  
                return one- two ;  
              } 
           });  

你可能感兴趣的:(List 中对象排序通用方法)