java 实现数组去重(集合转换)

	public static void main(String[] args) {
		int[] nums = { 5, 6, 6, 6, 8, 8, 7 };
		List<Integer> numList = new ArrayList<Integer>();
		for (int i : nums)
			numList.add(i);
		Set<Integer> numSet = new HashSet<Integer>();
		numSet.addAll(numList);
		System.out.println(numSet);
	}

  

原文地址:https://www.cnblogs.com/silianbo/p/4628655.html