- 1
Does it mean that the 3rd element change to 42????
2 Antworten
+ 2
What code are you referring to? Without showing it, we effectively won't be able to help you.
+ 2
If you mean this example:
https://www.sololearn.com/learn/Java/2148/?ref=app
Yes.
int[] arr = new int[5];
all elements are 0:
{0, 0, 0, 0, 0}
arr[2] = 42;
0, 0, 42, 0, 0