import java.util.ArrayList;import java.util.List;import java.util.Collection; class foo { public static void bar(List a, Collection b){ System.out.println(1);} public static void bar(Collection a, List b){ System.out.println(2);} public static void main(String[] a){ bar(new ArrayList(), new ArrayList());} }
Standard input is empty
Main.java:16: reference to bar is ambiguous, both method bar(java.util.List,java.util.Collection) in foo and method bar(java.util.Collection,java.util.List) in foo match bar(new ArrayList(), new ArrayList()); ^ 1 error
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!