I read that the enhanced for loop is more efficient than the normal for loop here:
http://developer.android.com/guide/practices/performance.html#foreach
When I searched for the difference between their efficiency, all I found is: In case of normal for loop we need an extra step to find out the length of the array or size etc.,
for(Integer i : list){
....
}
int n = list.size();
for(int i=0; i < n; ++i){
....
}
But is this the only reason, the enhanced for loop is better than the normal for loop? In that case better use the normal for loop because of the slight complexity in understanding the enhanced for loop.
Check this for an interesting issue: http://www.coderanch.com/t/258147/java-programmer-SCJP/certification/Enhanced-Loop-Vs-Loop
Can any one please explain the internal implementation of these two types of for loops, or explain other reasons to use the enhanced for loop?