Site Search:

OCPJP Simulation Test 61

<Back to OCPJP





Question: Given Set<? super RuntimeException> set = new HashSet<Exception>(), 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());