0% found this document useful (0 votes)
33 views4 pages

Java9 Mock Test IV

Uploaded by

usgod255
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views4 pages

Java9 Mock Test IV

Uploaded by

usgod255
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

JAVA 9 MOCK TEST

http://www.tutorialspoint.com Copyright © tutorialspoint.com

Advertisements

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.

JAVA 9 MOCK TEST

Q 1 - Which of the following is a correct statement about @Deprecated Annoation?

A - since returns the version in which the annotated element became deprecated.

B - Default value of since is empty string.

C - Both of the above.

D - None of the above

Q 2 - 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

Q 3 - 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

Q 4 - 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

Q 5 - What is the purpose of Optional Class?

A - To avoid null checks

B - To avoid NullPointerException issues

C - Both of the above

D - None of the above

Q 6 - Which of the following correctly describes the stream() method of Optional class?

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

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

C - Both of the above

D - None of the above

Q 7 - Which of the following correctly describes the ifPresentOrElse() method of Optional class?

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

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

C - Both of the above

D - None of the above

Q 8 - Which of the following correctly describes the or() method of Optional class?

A - If a value is present, it returns a sequential Stream containing only that value, otherwise returns an
empty Stream.
B - If a value is present, performs the given action with the value, otherwise performs the given empty-
based action.

C - If a value is present, returns an Optional describing the value, otherwise returns an Optional produced
by the supplying function.

D - None of the above

Q 9 - 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

Q 10 - What is goal behind MultiResolutionImage Interface?

A - It supports multiple images with different resolution variants.

B - This allows a set of images with different resolution to be used as a single multi-resolution image.

C - Both of the above

D - None of the above

Q 11 - Which of the following correctly describes the getResolutionVariant() method of


MultiresolutionImage Interface?

A - Gets a specific image which is best variant to represent this logical image at the indicated size.

B - Gets a readable list of all resolution variants.

C - Both of the above

D - None of the above

Q 12 - Which of the following correctly describes the getResolutionVariants() method of


MultiresolutionImage Interface?

A - Gets a specific image which is best variant to represent this logical image at the indicated size.

B - Gets a readable list of all resolution variants.

C - Both of the above

D - None of the above

Q 13 - Which of the following correctly describes the getResolutionVariants() method of


MultiresolutionImage Interface?
A - Gets a specific image which is best variant to represent this logical image at the indicated size.

B - Gets a readable list of all resolution variants.

C - Both of the above

D - None of the above

ANSWER SHEET

Question Number Answer Key

1 C

2 A

3 C

4 B

5 C

6 A

7 B

8 C

9 C

10 C

11 A

12 B

13 B

You might also like