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 static method

B - Default method

C - Static method

D - All of the above.

Answer : A

Explanation

Private static method support is added in Java 9.

Answer : C

Explanation

dropWhile method throw away all the values at the start until the predicate returns true. It returns, in case of ordered stream, a stream consisting of the remaining elements of this stream after dropping the longest prefix of elements matching the given predicate.

Answer : C

Explanation

Both of the above options are correct.

Answer : C

Explanation

Optional Class was introduced in Java 8 to avoid null checks and NullPointerException issues.

Answer : C

Explanation

With Java 9, a new multi-resolution image API has been introduced which supports multiple images with different resolution variants. This API allows a set of images with different resolution to be used as a single multi-resolution image.

Answer : B

Explanation

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

Answer : A

Explanation

newIncompleteFuture() − Returns a new incomplete CompletableFuture of the type to be returned by a CompletionStage method. Subclasses of CompletableFuture class should override this method to return an instance of the same class as this CompletableFuture. The default implementation returns an instance of class CompletableFuture.

java9_questions_answers.htm
Advertisements