What is faster in Java. Accessing an array index directly multiple times, or saving the value of the array index to a new variable and use this for following compution?
The second approach is faster, but will consume more memory. But the performance increases is only nano seconds, unless you array size is huge.