Is there any performance difference between the for loops on a primitive array?
Assume:
double[] doubleArray = new double[300000]; for (double var: do
There is no difference. Java will transform the enhanced for into the normal for loop. The enhanced for is just a "syntax sugar". The bytecode generated is the same for both loops.