Java Operators

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 Interfaces

Java Data Structures

Java Collections Algorithms

Advanced Java

Java Miscellaneous

Java APIs & Frameworks

Java Class References

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 an operation upon two double-valued operands and producing a double-valued result?

A - BooleanSupplier

B - Consumer<T>

C - DoubleBinaryOperator

D - DoubleConsumer

Answer : C

Explanation

DoubleBinaryOperator functional interface represents an operation upon two double-valued operands and producing a double-valued result.

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

A - IntToDoubleFunction

B - IntToLongFunction

C - IntUnaryOperator

D - LongBinaryOperator

Answer : B

Explanation

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

Q 4 - Which of the following functional interface represents an operation upon two long-valued operands and produces a long-valued result?

A - IntToDoubleFunction

B - IntToLongFunction

C - IntUnaryOperator

D - LongBinaryOperator

Answer : D

Explanation

LongBinaryOperator functional interface represents an operation upon two long-valued operands and produces a long-valued result.

Q 5 - Which of the following functional interface represents a supplier of results?

A - ObjIntConsumer<T>

B - ObjLongConsumer<T>

C - Predicate<T>

D - Supplier<T>

Answer : D

Explanation

Supplier<T> functional interface represents a supplier of results.

Answer : B

Explanation

Using name of the interface.

Answer : C

Explanation

Both of the above options are correct.

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

A - getUrlDecoder()

B - getUrlEncoder()

C - getMimeDecoder()

D - getMimeEncoder

Answer : B

Explanation

getUrlEncoder() method of Base64 class returns a Base64.Encoder that encodes using the URL and Filename safe type base64 encoding scheme.

Q 9 - Optional is a container object which is used to contain not-null objects.

A - true

B - false

Answer : A

Explanation

Optional is a container object which is used to contain not-null objects.

Q 10 - In which of the following type of Base64 encoding, Output is mapped to a set of characters lying in A-Za-z0-9+_?

A - Simple

B - URL

C - MIME

D - None of the above.

Answer : B

Explanation

URL − Output is mapped to a set of characters lying in A-Za-z0-9+_.

java8_questions_answers.htm
Advertisements
Morty Proxy This is a proxified and sanitized view of the page, visit original site.