Java generic method declaration

generics, java

Solution

In the latter you have a reference to the type within the scope of `someMethod`, namely `E`. In the former you do not.

Problem

I'm learning Java generics and I ask myself this question. What is the difference between these two method declarations? ``` public static void someMethod(List<? extends Number> numberList); ``` and ``` public static <E extends Number> void someMethod(List<E> numberList); ```

Original source

Related problems