
Java Streams Quiz
Quiz
•
Computers
•
Professional Development
•
Practice Problem
•
Medium
Rolland Gavriliță
Used 1+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following does not create a Java Stream?
List.of("a","b").stream()
Arrays.stream(new int[]{1,2,3})
Stream.of("x","y","z")
new Stream()
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does it mean that Java Streams are “lazy”?
They pause between elements.
Intermediate operations don’t run until a terminal operation is invoked.
They execute on a background thread.
They cache all elements in memory.
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is a terminal Stream operation?
filter(...)
map(...)
sorted()
collect(...)
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the result of this code? List names = List.of("Ana","Bob","Cip"); long c = names.stream() .filter(s -> s.length() > 3) .count(); System.out.println(c);
3
2
1
0
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Given List.of(3,1,2,3,2), what does .stream().distinct().sorted().toList() produce?
[1,2,3]
[3,2,1]
[3,1,2,3,2]
[2,3,1]
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which operation would you use to convert a Stream> into a Stream?
map(...)
flatMap(...)
collect(...)
filter(...)
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does this do? List nums = List.of(2,3,4); int result = nums.stream().reduce(1, (a,b)->a*b);
Concatenates numbers as strings
Calculates the product (24)
Throws an exception
Calculates sum (9)
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
8 questions
Modulo 2-Clase 1-Tecnologias Internet
Quiz
•
Professional Development
10 questions
Kiểu kí tự
Quiz
•
Professional Development
10 questions
Python-Quiz-Basic-Datatypes
Quiz
•
12th Grade - Professi...
10 questions
C Programming
Quiz
•
Professional Development
12 questions
Лекция №3 (Архитектура компьютера)
Quiz
•
Professional Development
13 questions
G Suite
Quiz
•
4th Grade - Professio...
10 questions
Introduction to Hyperconverged: HCI 101
Quiz
•
Professional Development
15 questions
Mantenimiento 2°2
Quiz
•
Professional Development
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Computers
10 questions
How to Email your Teacher
Quiz
•
Professional Development
6 questions
3RD GRADE DECLARATION OF INDEPENDENCE EXIT TICKET
Quiz
•
Professional Development
19 questions
Black History Month Trivia
Quiz
•
6th Grade - Professio...
22 questions
Multiplying Exponents with the Same Base
Quiz
•
9th Grade - Professio...
40 questions
Flags of the World
Quiz
•
KG - Professional Dev...
