java String[]字符串数组自动排序

import java.util.Arrays;

public class xulie {

 /**
  * @param args
  */
 public static void main(String[] args) {
  // TODO Auto-generated method stub

 
  String []str = {"abc","bca","cab","cba","aaa","111","232","112","ABC"};

  Arrays.sort(str);
  for(int i=0;i    System.out.println(str[i]);
  }
 }

}

 

 

打印结果:(数字、大写、小写,安装ACS码值进行排序)

111
112
232
ABC
aaa
abc
bca
cab
cba

你可能感兴趣的:(java String[]字符串数组自动排序)