Task 4 of 7 · 0 solved · 7 to go0%
You can read the problem, but answers are checked only for signed-in students. Sign in to answer →

11.4 Lambdas and streams — count positive numbers

Total: 0 / 3 pts
Practice mode — check each part and get hints as you go.
Task

Fill in countPositive using a stream so that it returns how many numbers are greater than 0.

filter keeps what matches, count reports how many remain — but it returns a long, so cast to int. The program prints 3 and then 0.

Your solution