Can anyone explain why Option G is wrong in question given below(Chapter-7 question 14 of
SCJP 1.5 book by kathy sierra)..???
Q. Given that
String implements java.lang.CharSequence, and:
Which declarations could be inserted at // INSERT DECLARATION HERE so that the program
will compile and run? (Choose all that apply.)
A. public static <E extends CharSequence> Collection<? extends CharSequence>
getLongWords(Collection<E> coll)
B. public static <E extends CharSequence> List<E>
getLongWords(Collection<E> coll)
C. public static Collection<E extends CharSequence> getLongWords(Collection<E> coll)
D. public static List<CharSequence>
getLongWords(Collection<CharSequence> coll)
E. public static List<? extends CharSequence>
getLongWords(Collection<? extends CharSequence> coll)
F. static public <E extends CharSequence> Collection<E>
getLongWords(Collection<E> coll)
G. static public <E super CharSequence> Collection<E>
getLongWords(Collection<E> coll)
In Answer explaination it is given that Option G is wrong because
E super CharSequence makes no sense�super could be used in conjunction with a wildcard but not a type variable like E.