I\'m not sure why the last statement in the following code is illegal. Integer should be a subtype of ?, so why can\'t I assign it to b
List> means a list typed to an unknown type.This could be a List of Integer, String or XYZ class.
Since you don't know what type of list is typed to, you can only read from the collection, and you can only treat the Objects read as being Object instance.
Please go for super wildcard boundary if you want to insert elements in the wildcard generic collection.