KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Is the following code valid? void myMethod (Class classType) { if (classType == MyClass.class) { // do something } } myMethod (OtherClass.class); If not is there any other approach where I can check if a passed .class (Class Type) is of type - MyClass ?
Tags (comma-separated)
Save Edits
Cancel