Can anyone let me know why addAll method allow to compile raw type in Generic List which already has restriction of String. As per my understanding addAll(Collection< ? extends T > c) will convert to addAll(Collection < ? extends String > c) which can take String or its subtype.
List<String> x = new ArrayList<String>();
x.add("sfhvjk");
//ArrayList<Integer> s = new ArrayList();
ArrayList s = new ArrayList();
//s.add("efyi");
s.add(3);
x.get(0);
x.addAll(s);// why its not giving compile time error?
for( Object o :x){
System.out.println(o);
}