I am just curious to ask this, maybe it is quite meaningless.
When we are using instanceof in java, like:
if (a instanceof Parent){ //\"Parent\" here is
When you write Parent.class
then that means you are creating a java.lang.Class
object for your Parent class.
So if (a instanceof Parent.class){
}
this will not work for you.
For more details on Class class take a look of following links :
Class
Instances of the class Class represent classes and interfaces in a running Java application. Every array also belongs to a class that is reflected as a Class object that is shared by all arrays with the same element type and number of dimensions. The primitive Java types (boolean, byte, char, short, int, long, float, and double), and the keyword void are also represented as Class objects.