可能是愚蠢的问题,但我怎样才能传递null给采用longor的方法int?
例子:
TestClass{
public void iTakeLong(long id);
public void iTakeInt(int id);
}
现在我如何将 null 传递给这两种方法:
TestClass testClass = new TestClass();
testClass.iTakeLong(null); // Compilation error : expected long, got null
testClass.iTakeInt(null); // Compilation error : expected int, got null
想法、建议?