当前位置: 代码迷 >> Java相关 >> 给出类的概要,支持能过遍历器访问自己的数据结构。写出这个遍历器
  详细解决方案

给出类的概要,支持能过遍历器访问自己的数据结构。写出这个遍历器

热度:212   发布时间:2006-07-14 16:39:01.0
给出类的概要,支持能过遍历器访问自己的数据结构。写出这个遍历器

class storage
{
private Object[] data=new Object[256];
// don't allow access to anythig not yet stored
private int nextEmptyslot=0;
private int i=0;
public Iterator iterator()
{
//return a class that iterates over the data array
return new Iterator(){
//insert the body of the inner class here
//3 methods:remove().hasNext();next()

};
}
}

搜索更多相关的解决方案: 遍历  数据结构  概要  访问  

----------------解决方案--------------------------------------------------------
楼主想干吗呢?
----------------解决方案--------------------------------------------------------
找人解答一下!!!
----------------解决方案--------------------------------------------------------
不懂 return new Iterator(){
//insert the body of the inner class here
//3 methods:remove().hasNext();next()

};
里面要怎么写??
----------------解决方案--------------------------------------------------------
你想干什么 ?
----------------解决方案--------------------------------------------------------
  相关解决方案