很多高级用法,比如Stream ,Compare都只针对包装类
直接int[] 到set只能使用赋值的方法
int[] nums = {0,0,1,1,1,2,2,3,3,4};
Set<Integer> set = new HashSet<>();
for (int i = 0; i < nums.length; i++) {
set.add(nums[i]);
}
标签:code,java,nums,int,set,随笔
From: https://www.cnblogs.com/xiaoyu-jane/p/16727524.html