List 之按照中文拼音首字母排序

public class TestCompare {
  
  private static Comparator comparator=Collator.getInstance(java.util.Locale.CHINA);
  public static void main(String[] args) {
    List<String> personList=Arrays.asList("帮大幅度","安大幅度","大地方","层 浮点");
    Collections.sort(personList,comparator);
    System.out.println(personList);
  }
}

你可能感兴趣的:(list,数据结构)