next(),使用方法iterator()要求容器返回一个Iterator。第一次调用Iterator的next()方法时,它返回序列的第一个元素。
(2) 使用next()获得序列中的下一个元素。
但是我还是不太明白
```SortedSet sortedset = new TreeSet(Arrays.asList(
"one two three four five six seven eight".split(" ")));
System.out.println(sortedset);
Object
low = sortedset.first(),
high = sortedset.last();
P.rintln("" + low);
P.rintln("" + high);
Iterator it = sortedset.iterator();
for(int i = 0; i < 7; i++){
if(i == 1) low = it.next();
if(i == 6) high = it.next();
else it.next();
}
P.rintln("" + low);
P.rintln("" + high);
P.rintln("" + sortedset);
[eight, five, four, one, seven, six, three, two]
eight
two
five
two
[eight, five, four, one, seven, six, three, two]
当 i == 1 ;当前元素是five,it.next(),后应该是four。这里不太理解了。感觉像返回当前元素一样