Java 9 - Online Quiz



Following quiz provides Multiple Choice Questions (MCQs) related to Java 9. 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

Answer : C

Explanation

Both of the options are correct.

Q 4 - Which of the following is a not valid member of interface till Java 8?

A - Private method

B - Default method

C - Static method.

D - All of the above.

Answer : A

Explanation

Private method support is added in Java 9.

Answer : C

Explanation

ofNullable method is introduced to prevent NullPointerExceptions and to avoid null checks for streams. This method returns a sequential Stream containing single element, if non-null, otherwise returns an empty Stream.

Answer : C

Explanation

Both of the above options are correct.

Q 8 - In which of the following version of java MultiResolutionImage Interface was introduced?

A - Java 7

B - Java 8

C - Java 9

D - None of the above

Answer : C

Explanation

With Java 9, a new multi-resolution image API has been introduced which supports multiple images with different resolution variants.

Answer : B

Explanation

getResolutionVariants() − Gets a readable list of all resolution variants.

Answer : B

Explanation

orTimeout() − This method exceptionally completes this CompletableFuture with a TimeoutException if not otherwise completed before the given timeout.

java9_questions_answers.htm
Advertisements