getClass( ): return the JavaClass of a JavaObject — LiveConnect
A JavaObject object.
The JavaClass object of
getClass( ) is a function
that takes a JavaObject object (
as an argument. It returns the JavaClass object of that JavaObject.
That is, it returns the JavaClass object that represents the Java
class of the Java object represented by the specified
getClass( ) function with the
getClass method of all Java objects. Similarly,
Consider the Java Rectangle object created with the following line:
var r = new java.awt.Rectangle( );
getClass( ) returns a JavaClass
object that represents the java.awt.Rectangle
var c = getClass(r);
You can see this by comparing this JavaClass object to
if (c == java.awt.Rectangle) ...
getClass( ) method
is invoked differently and performs an entirely different
c = r.getClass( );
After executing this line of code,
c is a JavaObject that represents a
java.lang.Class object. This
java.lang.Class object is a Java
object that is a Java representation of the
java.awt.Rectangle class. See your Java
documentation for details on what you can do with the
To summarize, you can see that the following expression ...