I am really new to Java and struggling a bit with arrays. I have a block of code that I wrote following the tutorial, but I'm trying to understand it and will love it if someone can explain it to me.
I tried to work with him in different ways (explaining my duck, writing it down, etc.), but still can not circle her. I usually didn’t ask, and I always try desperately to work hard on it, but this time I just can’t understand.
int[] values = new int[3];
values[0] = 10;
values[1] = 20;
values[3] = 30;
for(int i = 0; i < values.length; i++) {
System.out.println(values[i]);
}
I understand why:
- The for loop iterates through the values in the "values".
- The loop continues the loop until I become less than the last value in the array.
, values[i] System.out.println(). Java, i values[]?
, , , .