Skip to content

Commit c7fc93d

Browse files
committed
💡 Documenting source code.
1 parent 05d1d65 commit c7fc93d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

MD/HashMap.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ map.forEach((key,value)->{
5050

5151
**强烈建议**使用第一种 EntrySet 进行遍历。
5252

53-
第一种可以把 key value 同时取出,第二种还得需要通过 key 取一次 value,效率较低, 第三种需要JDK1.8以上,通过外层遍历table,内层遍历链表或红黑树。
53+
第一种可以把 key value 同时取出,第二种还得需要通过 key 取一次 value,效率较低, 第三种需要 `JDK1.8` 以上,通过外层遍历 table,内层遍历链表或红黑树。
5454

5555

5656
## notice

src/main/java/com/crossoverjie/basic/HashMapTest.java

+5
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,10 @@ public static void main(String[] args) {
3333
System.out.println("key=" + key + " value=" + map.get(key));
3434

3535
}
36+
37+
System.out.println("=============");
38+
map.forEach((key, value) -> {
39+
System.out.println("key=" + key + " value=" + map.get(key));
40+
});
3641
}
3742
}

0 commit comments

Comments
 (0)