Site Search:

OCPJP Simulation Test 60

<Back to OCPJP





Question: Given Collection<? super Exception> queue = new ArrayList<Exception>(), what are the following code compiles?

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