jeudi 24 décembre 2015

Get a field's value

I want to get the value with which the field is being initialized. Example:

class ClassA {
  public String someString = "Merry Christmas";
}

class ClassB {
 String anotherString = ClassA.class.getField("someString");
}

Is there any way to do this?





Aucun commentaire:

Enregistrer un commentaire