- Java 9 Tutorial
- Java 9 - Home
- Java 9 - Overview
- Java 9 - Environment Setup
- Java 9 - Module System
- Java 9 - REPL (JShell)
- Java 9 - Improved JavaDocs
- Java 9 - Multirelease JAR
- Java 9 - Collection Factory Methods
- Java 9 - Private Interface Methods
- Java 9 - Process API Improvements
- Java 9 - Stream API Improvements
- Try With Resources improvement
- Enhanced @Deprecated Annotation
- Inner Class Diamond Operator
- Optional Class Improvements
- Java 9 - Multiresolution Image API
- CompletableFuture API Improvements
- Java 9 - Miscellaneous Features
- java9 Useful Resources
- Java 9 - Questions and Answers
- Java 9 - Quick Guide
- Java 9 - Useful Resources
- Java 9 - Discussion
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.
Q 1 - Which of the following is correct about Module System in Java 9?
A - A new optional phase,link time, is introduced.
B - Link time phase is in-between compile time and run time.
Answer : D
Explanation
All of the above are correct.
Q 2 - Which of the following is correct w.r.t Multirelease jar?
Answer : C
Explanation
Both of the above options are correct.
Q 3 - Which of the following method is correct about Map in Java 9?
A - For Map interfaces, of(...) method is overloaded to have 0 to 10 parameters.
B - For Map interfaces, ofEntries(...) method is having var arg as parameter.
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?
Answer : A
Explanation
Private method support is added in Java 9.
Q 5 - Which of the following is a correct statement about ofNullable() method of Stream class 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.
Q 6 - Which of the following is a correct statement about try-with-resources statement?
A - The try-with-resources statement is a try statement with one or more resources duly declared.
Answer : D
Explanation
All of the above options are correct.
Q 7 - Which of the following is a correct statement about @Deprecated Annoation?
A - forRemoval indicates whether the annotated element is subject to removal in a future version.
Answer : C
Explanation
Both of the above options are correct.
Q 8 - In which of the following version of java MultiResolutionImage Interface was introduced?
Answer : C
Explanation
With Java 9, a new multi-resolution image API has been introduced which supports multiple images with different resolution variants.
Q 9 - Which of the following correctly describes the getResolutionVariants() method of MultiresolutionImage Interface?
Answer : B
Explanation
getResolutionVariants() − Gets a readable list of all resolution variants.
Q 10 - Which of the following correctly describes the orTimeout() method of CompletableFuture Interface?
Answer : B
Explanation
orTimeout() − This method exceptionally completes this CompletableFuture with a TimeoutException if not otherwise completed before the given timeout.
To Continue Learning Please Login
Login with Google