0
how to access the name of array. is there any way to do this.
2 Antworten
+ 7
You should first read the information ChaoticDawg posted to understand reflections. And here is another 'short' example which you can use, once you got it (Java8):
http://www.javaquery.com/2015/04/how-to-get-fieldsvariables-name-and.html?m=1
+ 3
Depending on the version of Java that your using and whether it is a class member you may be able to achieve this via reflection.
https://docs.oracle.com/javase/tutorial/reflect/class/classMembers.html