I simply want to get the last value in an ArrayList using reflection. Typically this is achieved by doing:
int x = ArrayList.get(ArrayList.size()-1);
I've tried doing:
int x = Object.get(ClassInstance, Object.get(ClassInstance, ArrayList.size()-1));
Obviously this isn't the correct syntax. What would the correct syntax be to achieve this?
Aucun commentaire:
Enregistrer un commentaire