Skip to main content
โœ๏ธ Code CompletionJV Java Hard+35 XP

Stream API

Complete the stream operation.

โœ๏ธ Fill in the blank
List<Integer> nums = Arrays.asList(1, 2, 3, 4, 5);
int sum = nums.stream()
    .filter(n -> n > 2)
    .___((a, b) -> a + b)
    .orElse(0);

โœ๏ธ Type the missing code:

Priygop - Leading Professional Development Platform | Expert Courses & Interview Prep