dimanche 23 août 2015

Getting value of int[] via reflection

Okay, so I'm trying to get the value of a int[] via reflection, and it's been going poorly. Here's my code:

What I'm trying to get value of

public int[] blah;

for(Field f : c.getDeclaredFields()) {
    f.setAccessible(true);
    if(f.getName().toLowerCase().contains("blah")) {
       Logger.write("Name: "+f.getName() +" Value:"+Array.get(f, 1));
    }
}

No matter what I do I keep getting "blah is not an array".





Aucun commentaire:

Enregistrer un commentaire