KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I want to check if an object o is an instance of the class C or of a subclass of C . For instance, if x is of class Point I want x.instanceOf(Point.class) to be true and also x.instanceOf(Object.class) to be true . I want it to work also for boxed primitive types. For instance, if x is an Integer then x.instanceOf(Integer.class) should be true . Is there such a thing? If not, how can I implement such a method?
Tags (comma-separated)
Save Edits
Cancel