Skip to content

Commit

Permalink
doc: Update java.md (#311)
Browse files Browse the repository at this point in the history
添加List和Set集合中打印时使用lamba输出的方式。
  • Loading branch information
Fuku-L committed Feb 23, 2023
1 parent 5ca71fd commit 2348522
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,8 @@ nums.remove(0); // 非常慢
for (Integer value : nums) {
System.out.println(value);
}
// lambda 打印元素
nums.forEach(e -> System.out.println(e.toString()));
```

### HashMap
Expand Down Expand Up @@ -653,6 +655,7 @@ set.remove("cat");
for (String element : set) {
System.out.println(element);
}
set.forEach(e -> System.out.println(e.toString()));
```

### ArrayDeque
Expand Down

0 comments on commit 2348522

Please sign in to comment.