Stream Collectors QuizS2C Home « Stream Collectors 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 class implementation of it.This quiz.
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 all about grouping & partitioning our streams.Quiz11
9 questions
Lesson 12 - Parallel StreamsThis lesson is all about parallel streams.Quiz12
8 questions

Streams Quiz 9

The quiz below tests your knowledge of the material learnt in Streams - Lesson 9 - Stream Collectors.

Question 1 : Which class has only static methods which are used in stream collectors?
- The <code>Collectors</code> class has only static methods which are used in stream collectors.
Question 2 : The characteristics() method returns a mutable set of Characteristics which define the behaviour of this Collector?
- The <code>characteristics()</code> method returns AN IMMUTABLE set of <code>Characteristics</code> which define the behaviour of this <code>Collector</code>.
Question 3 : Which Collectors method adapts a Collector to perform an additional finishing transformation?
- The <code>collectingAndThen()</code> method of the <code>Collectors</code> adapts a <code>Collector</code> to perform an additional finishing transformation.
Question 4 : The methods of the Collectors class are all static?
- The methods of the <code>Collectors</code> class ARE all static.
Question 5 : Which of these Collector interface methods is not required to execute a sequential reduction of a stream?
- The <code>combiner()</code> interface method is not required to execute a sequential reduction of a stream, as this is used for parallel processing alongside the other methods.
Question 6 : We use a static import for methods of the Collectors class?
- We DO use a static import for methods of the <code>Collectors</code> class as all methods in this class are static.
Question 7 : Characteristics.IDENTITY_FINISH indicates what?
- <code>Characteristics.IDENTITY_FINISH</code> indicates that the <code>supplier()</code> and <code>finisher()</code> methods are the same and so the <code>finisher()</code> method can be left out.
Question 8 : There are two variants of the toMap() method?
- There are THREE variants of the <code>toMap()</code> method.
Quiz Progress Bar Please select an answer

What's Next?

In the next quiz we test your knowledge of collecting & aggregating streams.