Challenge: Filtering Users by Two Criteria
Tarea
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
BiPredicate
to check ifage
is greater than 18 andstatus
is "Active". - Inside
forEach()
, use theif
statement to evaluate the user based on theBiPredicate
. - If the user satisfies the condition, print the user to the console.
Solución
solution
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 1. Capítulo 14