方法中定义的类的访问权限
public Set entrySet() {
class CoveredHashSet extends HashSet{//这个内部类是不是只能设为包访问权?
public String toString(){
StringBuffer s = new StringBuffer( " ");
Iterator
ki = keys.iterator(),
vi = values.iterator();
while(ki.hasNext()) {
s.append(ki.next() + "= " + vi.next()+ "\n ");
//if(ki.hasNext())
// s.append( ", ");
}
//s.append( "} ");
return s.toString();
}
}
}
------解决方案--------------------也可以设为别的访问权,比如private等