public interface Sorter{
public <T extends Comparable<T>> void sort(T[] list);
//定义两个待排序的集合
}
public class bubblie implements Sorter{
public <T extends Comparable<T>> void sort(T[] list){
boolean flag = true;
for(int i = 1,len = list.length;i<len&&flag;++i){
flag = false;
for(int j =0; j<len-1;++j){
if(list[j].compareTo(list[j + 1])>0){
T temp = list[j];
list[j] = list[j +1];
list[j +1] = temp;
flag = true;
}
}
}
}
}