I would like to know if the following code would increase the array value to the next array value every time it runs.
For e.g, on the first run, it stores value in count[1] of the array,
on the next run does it store the value in count[2]?
public static void getadminName(){
String[] name= new String[20];
for (int count=0;count<name.length;count++){
name[count]= JOptionPane.showInputDialog(null,"Please enter
admin's name:");
String scount=Integer.toString(count);
name[count]= scount+1;
break;
}
}
name[count] = JOptionPane.showInputDialog(null, "Please enter admin's name:");is redundant here.name[count] = scount + 1;overwrites the valuevoidmethods a name beginning withget, that is really disturbing and the only thing you get doing so will be trouble.