日期:2014-05-20 浏览次数:20832 次
public String[] sort(String[] str_Array) {
if(str_Array==null) {
throw new NullPointerException("The str_Array can not be null!");
}
String tmp = "";
for(int i=0;i<str_Array.length;i++) {
for(int j=0;j<str_Array.length-i-1;j++) {
if(str_Array[j].compareTo(str_Array[j+1])<0) {
tmp = str_Array[j];
str_Array[j] = str_Array[j + 1];
str_Array[j + 1] = tmp;
}
}
}
return str_Array;
}