.jnull
is necessary if null
is to be passed as an
argument of .jcall
or .jnew
, in order to be
able to find the correct method/constructor.
Example: given the following method definitions of the class A
:
Calling .jcall("A",,"run",NULL)
is ambiguous, because it is
unclear which method is to be used. Therefore rJava requires class
information with each argument to .jcall
. If we wanted
to run the String-version, we could use
.jcall("A",,"run",.jnull("java/lang/String"))
.
is.jnull
is a test that should be used to determine whether a
given Java reference is a null
reference.