What will be the result of attempting to compile and run the following code?.
public class Main { public static void main(String[] args) { List<? super Integer> sList = new ArrayList<Number>(); //(1) int i = 2007; sList.add(i); sList.add(++i); //(2) Number num = sList.get(0); //(3) } }
Select the one correct answer.
(c)
We can only get an Object from a List<? super Integer>.
The list could contain Comparable objects, and Number does not implement Comparable.