Call Java constructor


  • JavaObj = javaObject(ClassName,x1,...,xN) example



JavaObj = javaObject(ClassName,x1,...,xN) returns Java® object array, JavaObj, created by the Java constructor for the class with the argument list matching x1,...,xN.


expand all

Create Java Object

Create a Java object, strObj, of class java.lang.String.

strObj = javaObject('java.lang.String','hello');

Input Arguments

expand all

ClassName — Name of Java classstring

Name of Java class, specified as a string.

Data Types: char

x1,...,xN — Java constructor input argumentsany type

Java constructor input arguments, 1 through N (if any), required by ClassName, specified by any type. The argument type is specified by the class constructor argument list.

Was this topic helpful?