vendredi 3 juin 2016

How can get the variable name from a Java interface if I Know the value?

I have a java interface that it goes like this: String User_Name= "username"; String User_Password="password"; ...

Inside to a different class I want to get the variable Name when I know the value. For example I know the "username" and i want to find in which variable this value is stored. I am expecting to get the User_Name. Can this occurred with reflection? Can someone help me?

Thank you





Aucun commentaire:

Enregistrer un commentaire