Hi,
I was wondering why the first method below can return an ArrayList, while the second one cannot.
public <T> List<?> method1(List<T> type) {
System.out.println(type);
return new ArrayList<String>();
}
public <T> List<T> method2(List<T> type) {
System.out.println(type);
return new ArrayList<String>();
}
Thanks!
Start Free Trial