Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Filtering Users by Two Criteria | Fundamentals and Functional Capabilities of 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: Filtering Users by Two Criteria

Tâche

Swipe to start coding

Filter the users who are over 18 years old and have an "Active" status, then print them to the screen.

  1. Create a BiPredicate to check if age is greater than 18 and status is "Active".
  2. Inside forEach(), use the if statement to evaluate the user based on the BiPredicate.
  3. If the user satisfies the condition, print the user to the console.

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 1. Chapitre 14
toggle bottom row

book
Challenge: Filtering Users by Two Criteria

Tâche

Swipe to start coding

Filter the users who are over 18 years old and have an "Active" status, then print them to the screen.

  1. Create a BiPredicate to check if age is greater than 18 and status is "Active".
  2. Inside forEach(), use the if statement to evaluate the user based on the BiPredicate.
  3. If the user satisfies the condition, print the user to the console.

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 1. Chapitre 14
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