07-20-2023, 03:18 PM
How does Java, Kotlin, and Android handle returning an Array value at a given index while incrementing the index value?
```Java
int[] someArray = new int[5];
int index = 0;
int result;
result = someArray[index++];
```
Which index would be passed to the result? Will it increment `index` first, then pass it to `someArray[1]`, or will it pass the original value of `index` to `someArray[0]` and then increment `index`?
```Java
int[] someArray = new int[5];
int index = 0;
int result;
result = someArray[index++];
```
Which index would be passed to the result? Will it increment `index` first, then pass it to `someArray[1]`, or will it pass the original value of `index` to `someArray[0]` and then increment `index`?