Search Header Logo

Streams

Authored by Pawan G

Other

Professional Development

Used 1+ times

Streams
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is a functional interface in Java?

  • An interface that has only one abstract method


An interface that has only one default method

An interface that has only one static method

An interface that has no methods

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the syntax of a lambda expression in Java?

(parameters) -> {body}

[parameters] -> {body}

{parameters} -> [body]

[parameters] -> [body]

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the benefit of using lambda expressions in Java?

They make the code more complex and verbose

  • They make the code more secure and robust


  • They make the code more concise and readable


  • They make the code more dynamic and flexible


4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is a stream in Java?

A sequence of bytes that can be read or written

A sequence of characters that can be displayed or printed

A sequence of numbers that can be sorted or searched

A sequence of elements that can be processed with functional operations

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the two types of stream operations in Java?


Filter and map

Source and sink

Intermediate and terminal

Reduce and collect

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following methods can be used to create an infinite stream in Java?

Stream.generate()

Stream.iterate()

Stream.range()

Both A and B

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following methods can be used to perform a reduction operation on a stream in Java?

stream.reduce()

stream.collect()

stream.sum()

Both A and B

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?