At Line 4 it is giving copiler error. Here List <? super Integer> means it takes Integer or its super type. But we can add only Integers to this List al. Then we know that elements from this list will have only Integers. Why it is allowing only for(Object : al) in Line 4
Actually, no.... <? super Integer> means that it is an unknown type, but can be Integer or its super type. We can add only Integers to this List, because that is the only way to satisfy that it be all the possible unknown types.
You don't know what type of elements are actually in the list -- hence, you don't know if the elements are actually Number types. The only thing that you do know is that the elements are Object types.
Henry