I am looking at the Java API from Oracle, particularly at this method that is part of the java.util.Arrays class:
public static <T> List<T> asList(T... a)
But how is it possible that this method is returning a List object when clearly it is an interface?
List interface Source code of Arrays.asList method
public static <T> List<T> More ...asList(T... a) {
return new ArrayList<T>(a);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With