【发布时间】:2012-12-27 22:48:36
【问题描述】:
可能重复:
Java.util.HashMap — why HashMap extends AbstractMap and implement Map?
Why would both a parent and child class implement the same interface?
WeakHashMap
但是 AbstractMapimplements 声明是多余的。
宣布它的原因是什么?
【问题讨论】:
-
文档冗余。
-
您是在文档中还是在实现本身中看到了这一点?
-
@fge:它在 Oracle JDK 的源代码中。真的写成
public class WeakHashMap<K,V> extends AbstractMap<K,V> implements Map<K,V>。
标签: java collections weakhashmap