方法重载空参数
public static void doSomething(Object obj) { System.out.println("Object called");}public static void doSomething(char[] obj) { System.out.println("Array called");}public static void doSomething(Integer obj) { System.out.println("Integer called");}
doSomething(null)
Integer
char[]
Integer
Object
慕码人8056858
达令说
相关分类