// HashMap中Entry实现类
static class Node<K,V> implements Map.Entry<K,V> {
final int hash;
final K key;
V value;
Node<K,V> next; public final K getKey() {
return key;
}
public final V getValue() {
return value;
}
}java.util.Map接口
Set<Map.Entry<K,V>> entrySet(): 获取到Map集合中所有的键值对对象的集合(Set集合)
补充: Map遍历方式2: 通过entrySet()获取Entry对象形式遍历知识点
如何利用Map的 entrySet() 方法进行遍历
总结:
java.util.Map接口
Set<Map.Entry<K,V>> entrySet(): 获取到Map集合中所有的键值对对象的集合(Set集合)