什么是null?
是null一个什么的实例?
什么集合null属于?
它是如何在记忆中表现出来的?
我添加了三个带参数的方法:
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");
}
Run Code Online (Sandbox Code Playgroud)
当我调用时doSomething(null),编译器会将错误视为模糊方法.所以是问题,因为Integer和char[]方法,或Integer和Object方法呢?