Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Factory Product Filtering | Intermediate Operations in Stream API
Stream API
course content

Course Content

Stream API

Stream API

1. Fundamentals and Functional Capabilities of Stream API
4. Practical Applications of Stream API

book
Challenge: Factory Product Filtering

Task

Swipe to start coding

The factory produces products represented by Product objects, which have the fields id, weight, and quality.

  1. Filter the products to keep only those with a quality of "GOOD" and a weight greater than 10.0.
  2. Extract only the id of the filtered products using a method reference.
  3. Once the result is collected into a list, print the id of the selected products using a method reference to println.

Solution

java

solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 2. Chapter 3
toggle bottom row

book
Challenge: Factory Product Filtering

Task

Swipe to start coding

The factory produces products represented by Product objects, which have the fields id, weight, and quality.

  1. Filter the products to keep only those with a quality of "GOOD" and a weight greater than 10.0.
  2. Extract only the id of the filtered products using a method reference.
  3. Once the result is collected into a list, print the id of the selected products using a method reference to println.

Solution

java

solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 2. Chapter 3
Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt