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.

Determine Class of Java Object

To find the class of a Java® object, use the class function. For example:

value = java.lang.Integer(0);
myClass = class(value)
myClass = java.lang.Integer

The class function does not tell you whether the class is a Java class. For this information, call the isjava function. For example, the class value is a Java class:

isjava(value)
ans = 
   1

To find out if an object is an instance of a specific class, call the isa function. The class can be a MATLAB® built-in, a user-defined class, or a Java class. For example:

isa(value,'java.lang.Integer')
ans = 
   1

See Also

| |