Ask a Question
Advertise on boostr.in
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 and arg 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 == null is true?
Sep 7, 2015
to add a comment.
Related Hot Questions
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
To avoid this verification in future, please