Given code:
public static void main(String[] args)
{
doSomething(new ArrayList());
}
public static void doSomething(Collection collection) {
System.out.println("Collection here!");
}
public static void doSomething(List list) {
System.out.println("List here!");
}
This prints out List here!
as expected, but is this behaviour defined somewhere in the Java Specifications so I can rely on it, given any Java implementation?