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

Challenge: Stream exercises - Java Tutorial

From the course: Functional Programming with Java

Start my 1-month free trial

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…

Contents