0
我建造了一流的夫妇的ArrayList:排序复杂类型
public class Couple<E,K> {
E first; K second;
Couple(E first, K second){
this.first = first;
this.second = second;
}
public E getFirst(){
return first;
}
public K getSecond(){
return second;
}
}
而一个ArrayList<Couple<String, Integer>>
ArrayList<Couple<URL, Integer>> a = ArrayList<Couple<URL, Integer>>();
a=fillArray();
我想排序“A”由夫妇的第二个元素的值是一个整数。
看一看:http://stackoverflow.com/questions/9708707/sorting-generic -arraylist-ON-A-场 –