Documentation Center

  • Trial Software
  • Product Updates

javaObject

Call Java constructor

Syntax

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

Description

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.

Examples

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.

See Also

| | | |

Was this topic helpful?