为set集合排序
时间:2020-06-18 16:00:27
收藏:0
阅读:71
public static void main(String[] args) {
HashSet<String> has = new HashSet<String>();
has.add("");
has.add("1");
has.add("0");
has.add("3");
has.add("2");
has.add("2");
has.add("4");
System.out.println(has);
TreeSet<String> tree = new TreeSet<String>(has);
tree.comparator();
System.out.println(tree);
}
输出为
原文:https://www.cnblogs.com/wangjianl/p/13157953.html
评论(0)