迭代器-iteration

class CoffrrIterator implements Iterator<Coffee> {
    int cunt = size;
    public boolean hasNext() {
        return count > 0;       
    }
    public Coffee next() {
     count--;
     return CoffeeGenerato.this.next();
    }    
    public void remove () {
    }    
}

代码来做编程思想

posted @ 2017-09-06 20:20  路迢迢  阅读(174)  评论(0编辑  收藏  举报