如果是for循环
for(int i=0;i<arr.length;i++) {
System.out.print(arr[i]);
if(i!=arr.length-1)
System.out.print(" ");
}
如果使用iterator迭代器
Iterator<Integer> it = sortset.iterator();
while(it.hasNext()) {
System.out.print(it.next());
if(it.hasNext())
System.out.print(" ");
}