Search the courses, subjects, tracks, games and features, or jump straight to a page.
5 cards from this section. Quick, good the night before a test.
What does the map() function do in a Java Stream?
Think about applying a function to each element.
What will be printed by this code: List.of(1, 2, 3).stream().filter(x -> x > 2).forEach(System.out::println);?
Consider the filtering condition.
What type of operation is map() in the Stream API?
Consider how map changes data in the stream.
True or False: filter() can remove elements from the stream based on a condition.
Think about how filter processes data.
Given a list of integers, write a Java stream operation that filters out odd numbers, doubles the remaining even numbers, and collects them into a Set.
Focus on correctly using filter() before map() and consider using the right collector.
Explain how you could use the reduce() operation to find the maximum value in a list.
Combine the concept of reducing with comparing values.
7 more questions in this section. Enroll free to practise them all.
Enroll free