Challenge: Filtering Users by Two Criteria
Uppgift
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.
Lösning
solution.java
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 1. Kapitel 14
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
Suggested prompts:
Sammanfatta detta kapitel
Explain code
Explain why doesn't solve task
Awesome!
Completion rate improved to 2.33
Challenge: Filtering Users by Two Criteria
Svep för att visa menyn
Uppgift
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.
Lösning
solution.java
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 1. Kapitel 14
single