Java 9 Mock Test



This section presents you various set of Mock Tests related to Java 9. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.

Questions and Answers

Java 9 Mock Test III

Answer : C

Explanation

Both of the above options are correct.

Answer : C

Explanation

Both of the above options are correct.

Q 5 - A program element annotated with @Deprecated means it should not be used for

A - Its usage may leads to errors

B - It may be incompatible in future version.

C - Both of the above.

D - None of the above

Answer : C

Explanation

Both of the above options are correct.

Answer : C

Explanation

Both of the above options are correct.

Answer : C

Explanation

Both of the above options are correct.

Answer : C

Explanation

Both of the above options are correct.

Q 9 - In which of the following version of java diamond operator was introduced?

A - Java 7

B - Java 8

C - Java 9

D - None of the above

Answer : A

Explanation

Diamond operator was introduced in java 7.

Q 10 - In which of the following version of java diamond operator can be used with anonymous inner classes?

A - Java 7

B - Java 8

C - Java 9

D - None of the above

Answer : C

Explanation

In java 9, diamond operator can be used with annonymous class to simplify code and improves readability.

Q 11 - In which of the following version of java Optional Class was introduced?

A - Java 7

B - Java 8

C - Java 9

D - None of the above

Answer : B

Explanation

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

Answer : C

Explanation

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

Answer : A

Explanation

If a value is present, it returns a sequential Stream containing only that value, otherwise returns an empty Stream.

Answer : B

Explanation

If a value is present, performs the given action with the value, otherwise performs the given empty-based action.

Answer Sheet

Question Number Answer Key
1 D
2 D
3 C
4 C
5 C
6 C
7 C
8 C
9 A
10 C
11 B
12 C
13 A
14 B
15 C
java9_questions_answers.htm
Advertisements