interface outInterface{
interface ccls{
void innerInterface();
}
void outInterface();
}可以这样实现内部借口
class test2 implements InterfaceTest.ccls{ public void innerInterface() {
}
}外部引用很像内部类 但又不同 哪位兄弟能给说明下这个内部接口的作用和意义啊```因为我看到Map接口中定义了一个内部接口
interface Entry<K,V> {
K getKey();
V getValue();
V setValue(V value);
boolean equals(Object o); int hashCode();
}
顺便有人也给我介绍下Entry这个接口的作用和意义啊``
interface ccls{
void innerInterface();
}
void outInterface();
}可以这样实现内部借口
class test2 implements InterfaceTest.ccls{ public void innerInterface() {
}
}外部引用很像内部类 但又不同 哪位兄弟能给说明下这个内部接口的作用和意义啊```因为我看到Map接口中定义了一个内部接口
interface Entry<K,V> {
K getKey();
V getValue();
V setValue(V value);
boolean equals(Object o); int hashCode();
}
顺便有人也给我介绍下Entry这个接口的作用和意义啊``
Map实现类中具体的数据就是以Entry作为条目来组织的.
比如HashMap 中就有这个实现
static class Entry<K,V> implements Map.Entry<K,V> {
long current = System.currentTimeMillis();
while (it.hasNext()) {
Entry<Date, String> entry = it.next();
if (current - entry.getKey().getTime() > MAX_TIME) {
it.remove();
}
}//蓝色部分提取出Date对象