External Interfaces Reference |
Syntax
Description
invokes the javaMethod(
'method_name','class_name',x1,...,xn)
static
method method_name
in the class class_name
, with the argument list that matches x1,...,xn
.
invokes the nonjavaMethod(
'method_name',
J,x1,...,xn)
static
method method_name
on the object J, with the argument list that matches x1,...,xn
.
Remarks
Using the javaMethod
function enables you to
The javaMethod
function enables you to use methods having names longer than 31 characters. This is the only way you can invoke such a method in MATLAB. For example:
With javaMethod
, you can also specify the method to be invoked at run-time. In this situation, your code calls javaMethod
with a string variable in place of the method name argument. When you use javaMethod
to invoke a static method, you can also use a string variable in place of the class name argument.
Note
Typically, you do not need to use javaMethod . The default MATLAB syntax for invoking a Java method is somewhat simpler and is preferable for most applications. Use javaMethod primarily for the two cases described above.
|
Examples
To invoke the static
Java method isNaN
on class, java.lang.Double
, use
The following example invokes the nonstatic
method setTitle
, where frameObj
is a java.awt.Frame
object.
See Also
javaArray
, javaObject
, import
, methods
, isjava
javaclasspath | javaObject |
© 1994-2005 The MathWorks, Inc.