Skip to Main Content Skip to Search
Product Documentation

javaObject - Invoke Sun Java constructor

Syntax

javaObject(ClassName, x1, ..., xn)

Description

javaObject(ClassName, x1, ..., xn) calls the Java constructor for class ClassName with the argument list that matches x1, ..., xn, to return a new object. ClassName is a string.

If there is no constructor that matches the class name and argument list passed to javaObject, an error occurs.

Tips

For more information, see Using the javaObjectEDT Function.

Examples

The following example constructs and returns a Java object of class java.lang.String:

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

See Also

fieldnames | import | isjava | javaArray | javaMethod | javaObjectEDT | methods

  


» Learn more
» Download free kit
» Get trial software

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS