【数组排序】数组中字符按字母排序

public class Test1 {
    
    public static void main(String[] aegs){
        
        String[] str = {"a","d","c","b","2","+","测试"};
        
        for (String string : str) {
            System.out.println(string);
        }
        
        Arrays.sort(str , String.CASE_INSENSITIVE_ORDER);
        
        for (String string : str) {
            System.out.println(string);
        }
    }
}

你可能感兴趣的:(java)