dimanche 18 décembre 2016

Obtain methods of a parent class using java reflection

Imagine that I need to obtain the methods of a parent class and that parent class is also extended to another. So when I use the ,

Method [] getMethods();

It gives all the methods existing in the parent class and as well methods of its parent class as well.

I only need to take the methods of the immediately parent class which are not overridden.

Can we use Method getMethod (String, Object ....); for this purpose? If not , for what we can use it.





Aucun commentaire:

Enregistrer un commentaire