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);
	}

  

posted @ 2015-07-07 22:01  阿司★*^_^*联波  阅读(448)  评论(0编辑  收藏  举报