Site Search:

OCPJP Simulation Test 63

<Back to OCPJP





Question: Given Set<? super Error> set = new HashSet<Throwable>(), what are the following code compiles?

Choice:
A. set.add(new Object());
B. set.add(new IllegalArgumentException());
C. set.add(new IOException());
D. set.add(new NumberFormatException());
E. set.add(new FileNotFoundException());
F. set.add(new Error());
G. set.add(new IndexOutOfBoundsException());
H. set.add(new StackOverflowError());