private static String[] nameArray = {"张三","李四","王二","付火"}; @SuppressWarnings("unchecked") public static void main(String[] args) { List<String> list = new ArrayList<String>(); for (int i = 0; i < nameArray.length; i++) { list.add(nameArray[i]); } // 创建一个比较器,语言环境为中国 Comparator<Object> comparator = Collator.getInstance(Locale.CHINA); // 集合提供排序方法,此方法为稳定排序 Collections.sort(list, comparator); for (String str : list) { System.out.println(str); } }