Organizational Research By

Surprising Reserch Topic

calling java varargs method with single null argument using -'null,language-design,java,varargs'


calling java varargs method with single null argument  using -'null,language-design,java,varargs'

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?
    
asked Sep 7, 2015 by rajesh
0 votes
5 views



Related Hot Questions



Government Jobs Opening


...