javaMethod
Call Java method
Description
javaMethod(
calls
the method in the class of the Java® object array with the signature
matching the arguments MethodName
,JavaObj
,x1,...,xN
)x1,...,xN
. Use javaMethod
to
call methods having names that exceed the maximum length of a MATLAB® identifier.
This approach is the only way you can call such a method in MATLAB.
To obtain the maximum identifier length, call the namelengthmax
function.
In general, use MATLAB syntax to call methods on Java objects.
method(object,arg1,...,argn)
Alternatively, use Java syntax.
object.method(arg1,...,argn)
javaMethod(
calls
the static method in class StaticMethodName
,ClassName
,x1,...,xN
)ClassName
.
In general, use MATLAB syntax to call static methods on Java objects.
class.method(arg1,...,argn)
Examples
Input Arguments
Tips
Use
javaMethod
to specify the method name as a variable to be invoked at runtime. When calling a static method, you also can use a variable in place of the class name argument. For example, see Call Method Specified at Runtime.
Version History
Introduced before R2006a
See Also
javaArray
| javaObject
| import
| methods
| isjava
| javaMethodEDT