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
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
Which of the following doesnotexist?
Correct Answer:
E
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
Given: java
List
.peek(System.out::print)
.limit(2)
.f orEach(i -> {});
What is the output of the given code fragment?
Correct Answer:
C