Possible Duplicate:
instanceof – incompatible conditional operand types
I am trying to use below code and getting compilation error.
Class<A> clas; //this is passed from service
clas instanceof SomeClass
This gives ma the following compilation error:
incompatible conditional operand types Class and SomeClass
Please help me!
instanceofused to check that given object is of type Class(SomeClass – right side parameter). You cannot useClassto check that instanceof another class. To check class equality or assainability you can useSomeClass.isAssignableFrom(clas)