From the course: Functional Programming with Java
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Challenge: Stream exercises - Java Tutorial
From the course: Functional Programming with Java
Challenge: Stream exercises
(uplifting upbeat music) - [Instructor] Now that we've had a lot of practice with Java Stream-related functions, in order to make sure that you really understand these functions, let's do a few simple challenges. As you can see, in this file that I've given you, there are three classes. One is a person class, one is a color class, and one is an employee class. Furthermore, down in the main method here, there is a few lists that I've created for you that contain some basic data using these classes. So what you're going to do is with each list, I've given you a challenge. For the first one here where we have a list of people objects, your task is, given this list, return a list that contains only the people's names, so this is going to be a list of only strings, okay? Your next challenge is given a list of cars, use the functions that we've talked about so far in this section to return a list that contains only the blue cars in this list. And last but not least, given the list of…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Map in Java8m 4s
-
(Locked)
Filter in Java10m 30s
-
(Locked)
Reduce in Java7m 46s
-
(Locked)
Collect in Java8m 8s
-
(Locked)
Challenge: Stream exercises1m 24s
-
(Locked)
Solution: Stream exercises3m 59s
-
(Locked)
Combine list functions4m 47s
-
(Locked)
Parallel streams5m 26s
-
(Locked)
Challenge: Average salary calculator2m 57s
-
(Locked)
Solution: Average salary calculator4m 10s
-
(Locked)
-