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

Task

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

book
Challenge: Filtering Users by Two Criteria

Task

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