I have an array
String myArray[]={"one","two","three","four"};
In my code I am using a string with the same name as the array.Is there anyway to make that string point to the array?
String theArray = "myArray";
theArray[0];
Is this even possible?
No.
You could use a
Map<String, String[]>to map a name to an array.A small example:
will print: