Site Search:

OCPJP Simulation Test 59

<Back to OCPJP





Question: Given Queue<? super IOException> queue = new LinkedList<IOException>(), what are the following code compiles?

Choice:
A. queue.add(new Throwable());
B. queue.add(new Object());
C. queue.add(new IOException());
D. queue.add(new RuntimeException());
E. queue.add(new FileNotFoundException());
F. queue.add(new Error());
G. queue.add(new IndexOutOfBoundsException());
H. queue.add(new ArrayIndexOutOfBoundsException());