Introducing Streams QuizS2C Home « Introducing 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 Streams we test your knowledge of the topics covered in the Introducing Streams lesson.This quiz.
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.Quiz9
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 1

The quiz below tests your knowledge of the material learnt in Streams - Lesson 1 - Introducing Streams.

Question 1 : In which version of Java was the Streams API added to the language
- The Streams API was added to Java in version 8.
Question 2 : What is returned after a stream has finished processing?
- After a stream has finished processing it can return <code>void</code>, an object type, a primitive type and also a collection or array.
Question 3 : Streams preserve ordering?
- There is no mutation of elements within a stream, so if the source is from something ordered like a list the stream will preserve the ordering of the list.
Question 4 : How many terminal operations should a stream have?
- Although a stream can have <code>0</code> terminal operations this is pointless as the stream will never execute and so a stream should have only ONE terminal operation.
Question 5 : Streams adopt an iterative approach to programming?
- Streams adopt a DECLARATIVE approach to programming.
Question 6 : What is an advantage of using streams?
- Streams are lazily loaded which can lead to benefits in performance.
Question 7 : Streams are consumed after use?
- Streams ARE consumed after use, meaning they can only be traversed once.
Question 8 : How many intermediate operations can a stream have?
- A stream can have ZERO, ONE or MULTIPLE intermediate operation.
Question 9 : Streams are persisted?
- Streams are NOT persisted although the elements can be stored in an underlying collection or generated when needed
Quiz Progress Bar Please select an answer

What's Next?

In the next quiz we test your knowledge of stream pipelining.