Given an enum
public enum Country {
INDIA("New Delhi"),
US("Washinton DC");
private String capital;
private Country(String capital) {
this.captital = capital;
}
// getters & setters
}
How can I get the field values, given the fieldName "capital" and Country.class using reflection?
Aucun commentaire:
Enregistrer un commentaire