Skip to content

Commit 0b938e0

Browse files
author
hsmak
committedFeb 18, 2021
committing changes...
1 parent 0778389 commit 0b938e0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎core-java/src/main/java/_ocp8/ch09_streams/Ch09AppRunner.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,10 @@ public static void main(String[] args) {
201201
map.entrySet().stream().forEach(System.out::println);
202202

203203
System.out.println("--- Sorting ---");
204-
System.out.println("-- 1. ByValue - Ascending --");
204+
System.out.println("-- 1.1 ByValue - Ascending --");
205+
map.entrySet().stream().sorted((e1, e2) -> e1.getValue() - e2.getValue()).forEach(System.out::println);
206+
System.out.println();
207+
System.out.println("-- 1.2 ByValue - Ascending --");
205208
map.entrySet().stream().sorted(Map.Entry.comparingByValue()).forEach(System.out::println);
206209
System.out.println();
207210

0 commit comments

Comments
 (0)
Please sign in to comment.