# Difference between <? super T> and <? extends T> in Java

What is the difference between List<? super T> and List<? extends T> ?

I used to use List<? extends T>, but it does not allow me to add elements to it list.add(e), whereas the List<? super T> allows.

I want to know the difference.

This is nothing but setting the bounds

super is a lower bound, and extends is an upper bound.

The solution is to use a form of bounded wildcard we haven't seen yet: wildcards with a lower bound. The syntax ? super T denotes an unknown type that is a supertype of T (or T itself; remember that the supertype relation is reflexive). It is the dual of the bounded wildcards we've been using, where we use ? extends T to denote an unknown type that is a subtype of T.