Calling Java varargs method with single null argument?

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 nulls. 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?

89
задан pathikrit 27 November 2012 в 01:41
поделиться