Which of the following does not create a Java Stream?

Java Streams Quiz

Quiz
•
Computers
•
Professional Development
•
Medium
Rolland Gavriliță
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
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)
Create a free account and access millions of resources
Similar Resources on Quizizz
6 questions
Создание массивов в Пайтон

Quiz
•
KG - Professional Dev...
15 questions
React - Exercício Final

Quiz
•
Professional Development
13 questions
Fortnite!

Quiz
•
KG - Professional Dev...
12 questions
R081 Pre-production documents

Quiz
•
11th Grade - Professi...
10 questions
SASS, CSS Animation, RWD

Quiz
•
Professional Development
11 questions
MS-900 - Module 2 - Full quiz

Quiz
•
Professional Development
10 questions
Basic Programming Kotlin

Quiz
•
Professional Development
10 questions
Graphs

Quiz
•
Professional Development
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade