00:00

QUESTION 11

Given: java
record WithInstanceField(String foo, int bar) { double fuz;
}
record WithStaticField(String foo, int bar) { static double wiz;
}
record ExtendingClass(String foo) extends Exception {}
record ImplementingInterface(String foo) implements Cloneable {} Which records compile? (Select 2)

Correct Answer: CD

QUESTION 12

Given: java
var deque = new ArrayDeque<>(); deque.add(1);
deque.add(2);
deque.add(3);
deque.add(4);
deque.add(5); System.out.print(deque.peek() + " "); System.out.print(deque.poll() + " "); System.out.print(deque.pop() + " "); System.out.print(deque.element() + " "); What is printed?

Correct Answer: C

QUESTION 13

Which of the following doesnotexist?

Correct Answer: E

QUESTION 14

A module com.eiffeltower.shop with the related sources in the src directory.
That module requires com.eiffeltower.membership, available in a JAR located in the lib directory.
What is the command to compile the module com.eiffeltower.shop?

Correct Answer: B

QUESTION 15

Given: java
List integers = List.of(0, 1, 2); integers.stream()
.peek(System.out::print)
.limit(2)
.f orEach(i -> {});
What is the output of the given code fragment?

Correct Answer: C