lundi 7 août 2017

How go through a class with a reflection? [duplicate]

I have the following class structure.

ClassA, with ClassB and ClassC as children.

I want go through a classB and classC only by param.?

I using this code:

public void func(Class<ClassA> A){...}

and use this function:

func(ClassB.class)

But not work, i get the next message:

The methodfunc(Class<ClassA>) in the type ClassWithFunc is not applicable for the arguments (Class<ClassB>)

Any idea for this work?

thanks.





Aucun commentaire:

Enregistrer un commentaire