188
Java Object getClass() Method
getClass() is the method of Object class. This method returns the runtime class of this object. The class object which is returned is the object that is locked by static synchronized method of the represented class.
Syntax
Returns
It returns the Class objects that represent the runtime class of this object.
Example 1
Output:
Class of Object obj is : java.lang.String
Example 2
Output:
Class of Object obj is : java.lang.String
Next TopicJava Object Class