I have some code here
String array[]=new String[5];
for(int i=0;i<array.length;i++){
array[i]= "item "+String.valueOf(i);
i++;
}
and this is log message what i got after application crash
java.lang.IndexOutOfBoundsException : Invalid array range: 5 to 5
Could you guys explain me why pls ? I just want to declare an array and use for loop to initialize array element, just dont know why my code didn't work . Thank you
i++. Why?