import
java. util.*;
class ForInstance {
public static void main(
String[] args) {
Object o = new HashSet< Double>();
// (1) Insert code here.
}
}
Which code when inserted at (1) will result in the program to compile and execute normally? Select the one correct answer.
(a) System. out. println (o instanceof Set);
(b) System. out. println (o instanceof Set<?>) ;
(c) System. out. println (o instanceof Set< Double>) ;
(d) System. out. println (o instanceof Set<? extends Number>) ;
(e) System. out. println (o instanceof Set<? super Number>) ;
I was sure that the (a) and (b) were the right answers and confirmed myself right by compiling, but the question says "one" correct answer. So do I safely assume that the question is wrong? If not, which would be a better choice?
[ October 02, 2005: Message edited by: Barry Gaunt ]