No. List<? super Number> means it could be a list of any type that is a supertype of Number. The problem is that the compiler can't say what type exactly. So it could be a List<Number> as well as a List<Object>. And in Java you can't assign List<SubType> to List<SuperType>, so the compiler can't guarantee that what you're doing is legal.
You can assign a List<Object> to a List<? super Number> reference - but not vice-versa, which is what you're effectively doing when trying to call that method. A List<? super Number> reference might, for instance, point to a List<Number>.
posted 8 years ago
Thank you Stephan and Matthew.
incandescent light gives off an efficient form of heat. You must be THIS smart to ride this ride. Tiny ad: