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);
}
原文:http://www.cnblogs.com/silianbo/p/4628655.html