Challenge: Factory Product Filtering
Opgave
Swipe to start coding
The factory produces products represented by Product
objects, which have the fields id
, weight
, and quality
.
- Filter the products to keep only those with a
quality
of"GOOD"
and aweight
greater than 10.0. - Extract only the
id
of the filtered products using a method reference. - Once the result is collected into a list, print the
id
of the selected products using a method reference toprintln
.
Løsning
solution
Var alt klart?
Tak for dine kommentarer!
Sektion 2. Kapitel 3