Java9 Mock Test IV
Java9 Mock Test IV
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.
A - since returns the version in which the annotated element became deprecated.
A - Java 7
B - Java 8
C - Java 9
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
A - Java 7
B - Java 8
C - Java 9
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.
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.
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.
A - Java 7
B - Java 8
C - Java 9
B - This allows a set of images with different resolution to be used as a single multi-resolution image.
A - Gets a specific image which is best variant to represent this logical image at the indicated size.
A - Gets a specific image which is best variant to represent this logical image at the indicated size.
ANSWER SHEET
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