public class ABC {
public static void main(String[] args) {
new ABC().sortStringArray();
}
public void sortStringArray(){
String[] a = new String[]{"Oscar", "Charlie", "Ryan",
"Adam", "David","aff","Aff","12","斗鱼","阿里巴巴","aaa","9527"};
System.out.println();
System.out.println("字符型数组排序,排序前:");
for (int i = 0;i < a.length;i++){
System.out.println(a[i] + ",");
}
System.out.println();
System.out.println("排序后;");
// 调用数组的静态排序方法sort,且不区分大小写
Arrays.sort(a,String.CASE_INSENSITIVE_ORDER);
for (int i = 0;i < a.length;i++){
System.out.println(a[i] + ",");
}
}
}