Difference between an unbound wildcard and a raw type

How List<?> differs from List<Object> The main difference is that the first line compiles but the second does not: List<?> list = new ArrayList<String> (); List<Object> list = new ArrayList<String> (); However, because you don’t know what the generic type of List<?> is, you can’t use its parameterized methods: List<?> list = new ArrayList<String> (); … Read more