different ways of checking the type of an object in java?

Posted by GK on Stack Overflow See other posts from Stack Overflow or by GK
Published on 2010-04-30T13:31:32Z Indexed on 2010/04/30 13:37 UTC
Read the original article Hit count: 102

Filed under:

I have an object obj and a class name MyClass, i can check whether obj is of the type MyClass using either instanceof or i can say obj.getClass().equals("MyClass"). So i want to know are there any other ways of checking the type of an object.

© Stack Overflow or respective owner

Related posts about java