Why extends HashMap and implements Map?
Hi,
I browsed the source of HashMap in JDK 5.0.
The declaration of the class puzzled me.
Declaration of HashMap:publicclass HashMap<K,V>
extends AbstractMap<K,V>
implements Map<K,V>, Cloneable, Serializable
Declaration of AbstractMap:publicabstractclass AbstractMap<K,V>implements Map<K,V>
Puzzle:
Now that AbstractMap has been declared to implement Map interface, and HashMap extends AbstractMap,
why HashMap is declared to implement Map interface again?
I don't think that's necessary.
a cup of Java, cheers!
Sha Jiang

