Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
What method do you use to collect stream results into a list?
Think about the main operation associated with gathering items from a stream.
Which collector would you use to split a list into two categories?
This collector takes a predicate to divide data.
What is the main purpose of the Stream API?
Think about the primary reason for its introduction into Java.
True or False: Collectors can partition a stream into multiple groups.
Recall the definition of partitioning in the context of streams.
Write a Java program that takes a list of employees and partitions them into two lists based on salary, one for employees earning above average and one for those below.
Look at how you can calculate averages and apply them as conditions in partitioning.
Construct a method that reads a list of words and returns a list of unique lengths of those words using the Stream API.
Think about how you can transform each word before collecting it into a list.
5 more questions in this section. Enroll free to practise them all.
Enroll free