public static void main(String[] args) {
Map<Object, Object> hashMap = new HashMap<>();
hashMap.put("a", 1);
hashMap.put("b", 2);
hashMap.put(null, "");
hashMap.forEach((k, v) -> {
System.out.println("key=" + k);
System.out.println("value=" + v);
});
}
网友评论