File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
java8-stream/src/main/java/io/github/biezhi/java8/stream/lesson1 Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ Java8 改变了我们思考和编码的方式,在这里你可以学习到 Java
2727| 第 5 课 | [ lambda 进阶] ( https://github.com/biezhi/learn-java8/blob/master/java8-lambda/README.md ) | [ 网易云课堂] ( http://study.163.com/course/courseLearn.htm?courseId=1005047049&utm_campaign=commission&utm_source=cp-400000000397038&utm_medium=share#/learn/video?lessonId=1051518174&courseId=1005047049 ) ¦ ; [ 哔哩哔哩] ( https://www.bilibili.com/video/av19287893/index_5.html#page=5 ) ¦ ; [ Youtube] ( https://youtu.be/3G83it4IASc ) | [ lambda3] ( https://github.com/biezhi/learn-java8/tree/master/java8-lambda/src/main/java/io/github/biezhi/java8/lambda/lesson3 ) |
2828| 第 6 课 | [ 默认方法的妙用] ( https://github.com/biezhi/learn-java8/blob/master/java8-default-methods/README.md ) | [ 网易云课堂] ( http://study.163.com/course/courseLearn.htm?courseId=1005047049&utm_campaign=commission&utm_source=cp-400000000397038&utm_medium=share#/learn/video?lessonId=1051518175&courseId=1005047049 ) ¦ ; [ 哔哩哔哩] ( https://www.bilibili.com/video/av19287893/index_6.html#page=6 ) ¦ ; [ Youtube] ( https://youtu.be/sAuEnkWezDM ) | [ default-method] ( https://github.com/biezhi/learn-java8/tree/master/java8-default-methods/src/main/java/io/github/biezhi/java8/defaultmethods ) |
2929| 第 7 课 | [ 干掉空指针之 Optional] ( https://github.com/biezhi/learn-java8/blob/master/java8-optional/README.md ) | [ 网易云课堂] ( http://study.163.com/course/courseLearn.htm?courseId=1005047049&utm_campaign=commission&utm_source=cp-400000000397038&utm_medium=share#/learn/video?lessonId=1051511464&courseId=1005047049 ) ¦ ; [ 哔哩哔哩] ( https://www.bilibili.com/video/av19287893/index_7.html#page=7 ) ¦ ; [ Youtube] ( https://youtu.be/br4kqCXPB9A ) | [ optional] ( https://github.com/biezhi/learn-java8/tree/master/java8-default-methods/src/main/java/io/github/biezhi/java8/optional ) |
30- | 第 8 课 | 理解 Stream | 网易云课堂 ¦ ; 哔哩哔哩 ¦ ; Youtube | |
30+ | 第 8 课 | [ 理解 Stream] ( https://github.com/biezhi/learn-java8/blob/master/java8-stream/README.md ) | [ 网易云课堂] ( http://study.163.com/course/courseLearn.htm?courseId=1005047049&utm_campaign=commission&utm_source=cp-400000000397038&utm_medium=share#/learn/video?lessonId=1051555343&courseId=1005047049 ) ¦ ; [ 哔哩哔哩] ( https://www.bilibili.com/video/av19287893/index_8.html#page=8 ) ¦ ; [ Youtube] ( https://youtu.be/NB9mGlNMl-w ) | [ stream ] ( https://github.com/biezhi/learn-java8/tree/master/java8-stream/src/main/java/io/github/biezhi/java8/stream/lesson1 ) |
3131| 第 9 课 | Stream API(上)| 网易云课堂 ¦ ; 哔哩哔哩 ¦ ; Youtube | |
3232| 第 10 课 | Stream API(下)| 网易云课堂 ¦ ; 哔哩哔哩 ¦ ; Youtube | |
3333| 第 11 课 | 新的日期时间 API | 网易云课堂 ¦ ; 哔哩哔哩 ¦ ; Youtube | |
Original file line number Diff line number Diff line change @@ -14,11 +14,19 @@ public class Java8 {
1414 public static void main (String [] args ) {
1515 List <Project > projects = Project .buildData ();
1616 List <String > names = projects .stream ()
17- .filter (p -> p .getStars () > 1000 )
18- .map (Project ::getName )
17+ .filter (p -> {
18+ System .out .println (p .getName ());
19+ return p .getStars () > 1000 ;
20+ })
21+ .map (p -> {
22+ System .out .println (p .getName ());
23+ return p .getName ();
24+ })
1925 .limit (3 )
2026 .collect (Collectors .toList ());
2127 System .out .println (names );
28+
29+ names .stream ().forEach (name -> System .out .println (name ));
2230 }
2331
2432}
You can’t perform that action at this time.
0 commit comments