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.
- Create a
BiPredicateto check ifageis greater than 18 andstatusis "Active". - Inside
forEach(), use theifstatement to evaluate the user based on theBiPredicate. - If the user satisfies the condition, print the user to the console.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 1. ChapterΒ 14
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 2.33
Challenge: Filtering Users by Two Criteria
Swipe to show menu
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.
- Create a
BiPredicateto check ifageis greater than 18 andstatusis "Active". - Inside
forEach(), use theifstatement to evaluate the user based on theBiPredicate. - If the user satisfies the condition, print the user to the console.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 1. ChapterΒ 14
single