(十)TreeSet自然排序和定制排序

package day23_集合;
import java.util.*;
public class class07_TreeSet {
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public static void main(String[] args) {
		Set set=new TreeSet();
		Collection col=Arrays.asList(1,20,-3,-55,236);
		set.addAll(col);
		System.out.println(set);
	}
}

在这里插入图片描述

发布了27 篇原创文章 · 获赞 3 · 访问量 2215

猜你喜欢

转载自blog.csdn.net/weixin_42992842/article/details/104112402
今日推荐