K
K
Hi
I was looking at the Arrays.java file that comes with the jdk source code
and found the following:
public static <T> List<T> asList(T... a) {
return new ArrayList<T>(a);
}
The problem is that ArrayList doesn't have a constructor that takes an array
as a parameter and the above code will not compile when copied into one of
your own classes.
Is the java source wrong/incomplete or am I missing something?
thx in advance
I was looking at the Arrays.java file that comes with the jdk source code
and found the following:
public static <T> List<T> asList(T... a) {
return new ArrayList<T>(a);
}
The problem is that ArrayList doesn't have a constructor that takes an array
as a parameter and the above code will not compile when copied into one of
your own classes.
Is the java source wrong/incomplete or am I missing something?
thx in advance