这是我的代码。我将 null 设置为这个引用,然后为什么它打印not null set
测试.java
try
{
new Test().setNull();
System.out.println("not null set");
}
catch (Exception e)
{//Catch exception if any
System.err.println("Error: " + e.getMessage());
}
}
public void setNull()
{
setNull(this);
}
public void setNull(Object thisRef)
{
thisRef = null;
}
输出:非空集