Javatpoint Logo
Javatpoint Logo

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

Test it Now

Output:

Class of Object obj is : java.lang.String

Example 2

Test it Now

Output:

Class of Object obj is : java.lang.String
Next TopicJava Object Class





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA