Consider the following code:
List<? extends Object> alist = new Vector<
String>();
alist.add("USA"); // compile time error
we know that this is giving compiler error because at compile time we don't know what the type is(like ? stands for what)hence at compile time if we try to add anything it will give error..
but my doubt is what is the use of new Vector<String>(); ??
Isn't new Vector<String>() is the runtime type of <? extends Object>