If I have a vararg Java method foo(Object ...arg)
and I call foo(null, null)
, I have both arg[0]
and arg[1]
as null
s. But if I call foo(null)
, arg
itself is null. Why is this happening?
How should I call foo
such that foo.length == 1 && foo[0] == null
is true
?