What is the difference between List<Integer> and List<? super Integer> .
Which one is a good practice or When we should use what ?
List<Integer> is a List that is bounded to a type Integer. This means that it can receive and produce Integer.
List<? super Integer> is a unbounded List that accepts any value that is a Integer or a superclass of Integer.
The 2nd option is best used on the PECS Principle (PECS stands for Producer Extends, Consumer super). This is useful if you want to add items based on a type T irrespective of it's actual type.
For more information, see a related post here.
superwork in this case?