给出类的概要,支持能过遍历器访问自己的数据结构。写出这个遍历器
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()
};
}
}