Skip to content

javaObject

java · scripts/java/javaObject.m

: jobj = javaObject (classname, …)

Construct a Java object of class classname, passing any further arguments to the matching constructor.

strObj = javaObject ("java.lang.String", "hello");
myDate = javaObject ("java.util.Date");
javaMethod ("setMonth", myDate, 3);
m = javaMethod ("getMonth", myDate);

The same construction is available via the dotted package form java.util.Date ().