Java Tutorial

Java Control Statements

Object Oriented Programming

Java Built-in Classes

Java File Handling

Java Error & Exceptions

Java Multithreading

Java Synchronization

Java Networking

Java Collections

Java List Interface

Java Queue Interface

Java Map Interface

Java Set Interface

Java Data Structures

Java Collections Algorithms

Advanced Java

Java Miscellaneous

Java APIs & Frameworks

Java Useful Resources

Java 8 Online Quiz



Following quiz provides Multiple Choice Questions (MCQs) related to Java 8. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Q 2 - Which of the following functional interface represents a supplier of Boolean-valued results?

A - BooleanSupplier

B - Consumer<T>

C - DoubleBinaryOperator

D - DoubleConsumer

Answer : A

Explanation

BooleanSupplier functional interface represents a supplier of Boolean-valued results.

Q 3 - Which of the following functional interface represents a function that accepts an int-valued argument and produces a double-valued result?

A - IntToDoubleFunction

B - IntToLongFunction

C - IntUnaryOperator

D - LongBinaryOperator

Answer : A

Explanation

IntPredicate functional interface represents a function that accepts an int-valued argument and produces a double-valued result.

Q 4 - Which of the following functional interface represents an operation on a single int-valued operand that produces an int-valued result?

A - IntToDoubleFunction

B - IntToLongFunction

C - IntUnaryOperator

D - LongBinaryOperator

Answer : C

Explanation

IntUnaryOperator functional interface represents an operation on a single int-valued operand that produces an int-valued result.

Q 5 - Which of the following functional interface represents a function that produces a long-valued result?

A - ToLongBiFunction<T,U>

B - ToLongFunction<T>

C - UnaryOperator<T>

D - ToIntFunction<T>

Answer : B

Explanation

ToLongFunction<T> functional interface represents a function that produces a long-valued result.

Answer : D

Explanation

The 'limit' method is used to reduce the size of the stream.

Q 7 - Which of the following class implements an encoder for encoding byte data using the Base64 encoding scheme in Java8?

A - Base64.Decoder

B - Base64.Encoder

C - Base64Decoder

D - Base64Encoder

Answer : B

Explanation

static class Base64.Encoder - This class implements an encoder for encoding byte data using the Base64 encoding scheme as specified in RFC 4648 and RFC 2045.

Q 8 - Which of the following method of Base64 class returns a Base64.Encoder that encodes using the MIME type base64 encoding scheme?

A - getDecoder()

B - getEncoder()

C - getMimeDecoder()

D - getMimeEncoder

Answer : D

Explanation

getMimeEncoder() method of Base64 class returns a Base64.Encoder that encodes using the MIME type base64 encoding scheme.

Q 9 - Method references help to point to methods by their names.

A - true

B - false

Answer : A

Explanation

Method references help to point to methods by their names.

Q 10 - The new date-time API in java 8 is immutable and does not have setter methods.

A - true

B - false

Answer : A

Explanation

The new date-time API in java 8 is immutable and does not have setter methods.

java8_questions_answers.htm
Advertisements