迭代器是导出到客户端的嵌套类。那么为什么声明为 private 而不是 public ?例如:
private abstract class HashIterator<E> implements Iterator<E> {
private final class EntryIterator extends HashIterator<Map.Entry<K,V>> {
public Map.Entry<K,V> next() {
return nextEntry();
}
}