Question: Given Deque<? super Reader> queue = new LinkedList<Reader>(), what are the following code compiles?
Choice:
A. queue.add(new Reader());
B. queue.add(new Writer());
C. queue.add(new FileReader());
D. queue.add(new BufferedInputStream());
E. queue.add(new BufferedReader());
F. queue.add(new PrintStream());
G. queue.add(new InputStreamReader());
H. queue.add(new printWriter());
Explain: regardless of the right side assignment, only the left side type declaration counts: Deque<? super Reader> queue You can only add the subclass of Reader to the queue. Of course you need to be familiar with NIO classes. We didn't choose A because Reader is an abstract class.