vendredi 6 octobre 2017

Get non-static inherited field with reflection

How can I get a non-static field of an extended class?

I know how to get static fields, but not how to get fields from an instance.


I already tried it with

Field commandName = command.getField("name");

but I get a NoSuchFieldException exception.





Aucun commentaire:

Enregistrer un commentaire