Grouping & Partitioning Streams QuizJ8 Home « Grouping & Partitioning Streams Quiz

The questions in this quiz on Java are on the topics covered in the Streams section of the site. The table below lists the lesson used for each quiz, a description of the lesson content and the quiz number and questions associated with that lesson.

Lesson Summary

Click on a lesson in the table to go to that lesson for a refresher on the topics for that quiz.

Click on a quiz in the table to go straight to the quiz for a particular lesson.

Generics Lessons Description Quiz Info.
Lesson 1 - Introducing StreamsIn our first lesson on on Streams we test your knowledge of the topics covered in the Introducing Streams lesson.Quiz1
9 questions
Lesson 2 - Stream PipelinesIn this lesson on streams we look at stream pipelines and how they work.Quiz2
9 questions
Lesson 3 - Stream Operations OverviewIn this lesson on streams we present an overview of the intermediate and terminal operations available.Quiz3
9 questions
Lesson 4 - Array Type StreamsIn this streams lesson we look at the various ways of creating streams from arrays.Quiz4
8 questions
Lesson 5 - Numeric StreamsIn this lesson on streams we look at numeric streams and the operations associated with them.Quiz5
7 questions
Lesson 6 - Other Stream CreationIn this lesson we take a final look at stream creation by creating streams from files, functions and iterations and also find out about creating infinite streams.Quiz6
9 questions
Lesson 7 - Finding & MatchingIn this streams lesson we look at the various ways of finding and matching values within our streams.Quiz7
9 questions
Lesson 8 - Reduction OperationsIn this streams lesson we look at reduction operations and how to use them.Quiz8
7 questions
Lesson 9 - Stream CollectorsIn this lesson we take a high level look at stream collectors by investigating the Collector<T,A,R> interface and the Collectors class implementation of it.Quiz9
8 questions
Lesson 10 - Collecting & Aggregating StreamsIn this lesson we look at how to create collections and aggregations from our streams.Quiz10
8 questions
Lesson 11 - Grouping & Partitioning StreamsThis lesson on streams is about grouping & partitioning streams.This quiz.
9 questions
Lesson 12 - Parallel StreamsThis lesson is all about parallel streams.Quiz12
8 questions

Streams Quiz 11

The quiz below tests your knowledge of the material learnt in Streams - Lesson 11 - Grouping & Partitioning Streams.

Question 1 : When using multilevel grouping on streams we will always end up with?
- When using multilevel grouping on streams we will always end up with a map within a map.
Question 2 : There are two variants of the groupingBy() static method in the Collectors class?
- There are THREE variants of the <code>groupingBy()</code> static method in the <code>Collectors</code> class.
Question 3 : What kind of function do we pass as the first parameter to the groupingBy() static method?
- We always pass a classification function as the first parameter to the <code>groupingBy()</code> static method.
Question 4 : We can acheive multi-level grouping using the groupingBy() static method?
- We CAN acheive multi-level grouping using the <code>groupingBy()</code> static method.
Question 5 : We can use the groupingBy() or partitioningBy() static methods but not both in tandem?
- We CAN use the <code>groupingBy()</code> static method as the second argument to the <code>partitioningBy()</code> static method, so we CAN use them in tandem.
Question 6 : Which Stream interface method is the groupingBy() static method of the Collectors class used in conjunction with?
- The <code>groupingBy()</code> static method of the <code>Collectors</code> class is used in conjunction with the <code>collect()</code>, method of the <code>Stream</code> interface.
Question 7 : The collectingAndThen() static method of the Collectors class adapts a Collector to perform an additional finishing transformation?
- The <code>collectingAndThen()</code> static method of the <code>Collectors</code> class DOES adapt a <code>Collector</code> to perform an additional finishing transformation.
Question 8 : What is returned from the classification function of the partitioningBy() static method of the Collectors class?
- A <code>boolean</code> is returned from the classification function of the <code>partitioningBy()</code> static method of the <code>Collectors</code> class and this is used as a key in the resultant map.
Question 9 : We can only achieve multi-level grouping using the three parameter variant of the groupingBy() static method of the Collectors class?
- We can achieve multi-level grouping using the two or three parameter variant of the <code>groupingBy()</code> static method of the <code>Collectors</code> class.
Quiz Progress Bar Please select an answer

What's Next?

In the next quiz we test your knowledge of parallel streams.