参见英文答案 >
Why do many Collection classes in Java extend the abstract class and implement the interface as well?10个
HashMap类实现了Map接口:
HashMap类实现了Map接口:
public class HashMap<K,V> extends AbstractMap<K,V> implements Map<K,V>,Cloneable,Serializable
LinkedHashMap类扩展了HashMap,这意味着它应该默认实现Map接口.为什么明确实现Map接口?
public class LinkedHashMap<K,V> extends HashMap<K,V>