If I have variable1, variable2 and variable 3. Is there anyway to get that variable with i?
Such as getting variablei , where i = 1.
Following code I think illustrates what I am talking about.
ArrayList networkSetupData = new ArrayList(count);
for(int i =0 ; i != count ; count--)
{
networkSetupData.add(dropDown[i]);
}
Thank you in advance.
You should basically restructure your code to have a single array or collection variable instead. You’ve got three variables which are clearly related, and which you want to access by index: you want a collection.
Instead of declaring
dropDown1,dropDown2,dropDown3, you should declaredropDownseither as aList<DropDown>or possibly aDropDown[]. Then you can access them by index at any time.