I have a String array myArray which is filled by picking data from mysql database. The database is dynamic and keeps changing and as the database changes, the elements in myArray also keep on changing. I have already achieved the above in my code.
I now want to create an array of integers but with the array name being the elements in myArray. For example, if I have:
String[] myArray = new String[2];
myArray[1] = "string1";
myArray[2] = "string2";
The above "string1" and "string2" are coming in from the database. Once myArray is populated, I now want to create an array of integers having names string1 and string2 like below:
int[] string1 = new int[10];
int[] string2 = new int[10];
Currently, myArray size is 30 but might go up to 50.
I am a java newbie and would appreciate if any java folks could tell me how I could achieve the above in my code.
Many thanks