public static void sortString(String[] arr) {
// TODO Auto-generated method stub
for (int i = 0; i < arr.length - 1; i++) {
for (int j = i + 1; j < arr.length; j++) {
if (arr[i].compareTo(arr[j]) > 0) {// 字符串比较用compareTo方法完成
swp(arr, i, j);
}
}
}
}
private static void swp(String[] arr, int i, int j) {
public static void printArry(String[] arr) {
// TODO Auto-generated method stub
System.out.print("[");//注意换行问题
for (int i = 0; i < arr.length; i++) {
if (i != arr.length - 1)
System.out.print(arr[i] + ",");
else
System.out.print(arr[i] + "]");