迭代器源码
public interface Iterator
{
public abstract boolean hasNext();
public abstract Object next();
}
public interface Collection
{
public abstract Iterator iterator();
}
public interface List extends Collection
{
...
}
public class ArrayList implements List
{
public Iterator iterator()
{
return new Itr();
}
private class Itr implements Iterator
{
public boolean hasNext(){...}
public Object next(){...}
ArryList类中的方法如何解读,求大神指导 |
|