//the first case show parameter for the List, can be compiled through, and show in the List. The add didn't prompt error (" 2 s ")
Show (list2);
Show (list3);
Public static void show List (List) {
List. The add (" 2 s ");//there is no error
System. The out. Println (list. Get (0));
}
//the second show parameter for List
//the third case show parameter for List<? & gt; , compile, however, show in the list. The add (" 2 s ") error
Show (list2);
Show (list3);
Public static void show (List<? & gt; The list) {
List. The add (" 2 s ");//this error
System. The out. Println (list. Get (0));
}
dear reader, is to explain the above three kinds of situation what's going on