This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Call Java constructor


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



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.


collapse all

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

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

Input Arguments

collapse all

Java class name, specified as a string or character vector.

Data Types: char

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

Introduced before R2006a