Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Java Reflection Field Array Type
if(field.getType().isArray() && field.getType() == String[].class) {
if(field.getName() == "SHORTCUT" || field.getName() == "URI") {
String[] x = (String []) field.get(field);
for(int i = 0; i < x.length; i++) {
//Do something
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment