public class Test { public void test(Object o) { System.out.println("Object"); } public void test(String s) { System.out.println("String"); } public static void main(String[] args) { Test that = new Test(); that.test(null); } }
jls8 §15.12.2 --------------- There may be more than one such method, in which case the most specific one is chosen. The descriptor (signature plus return type) of the most specific method is the one used at run time to perform the method dispatch.