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

Contenu du cours

Stream API

Stream API

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

book
Challenge: Factory Product Filtering

Tâche

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 desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 2. Chapitre 3
toggle bottom row

book
Challenge: Factory Product Filtering

Tâche

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 desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 2. Chapitre 3
Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
We're sorry to hear that something went wrong. What happened?
some-alt