(1Z0-811) Oracle Java SE11 Programmer Practice Test
(1Z0-811) Oracle Java SE11 Programmer 1Z0-811 Core Java API
What is the output of the following code?
import java.util.*;
public class Test {
public static void main(String[] args) {
List list = Arrays.asList("A", "B", "C");
list.add("D");
}
}
Select your answer
A
Compilation error
B
Runtime error
C
The list will contain ["A", "B", "C", "D"]
D
The list will contain ["A", "B", "C"] and "D" will not be added
Hint