Ankit Garg wrote:the compiler doesn't know the exact type of a collection when you use <? super Type> syntax. What the compiler knows is that you can add elements of Type to that collection but not its super classes. In your case you can add elements of type String to the set but not super classes of String...
line 1 if uncommented gives error.
<? super Type> says you can add elements of
Type to that collection but not its super classes,also please accept any collection with generic type or a it's super type.
here you can pass super type to the method demanding <? super Type> but can't add super type to collection directly.