why is the enhanced for loop more efficient than the normal for loop
It’s a bit of an oversimplification to say that the enhanced for loop is more efficient. It can be, but in many cases it’s almost exactly the same as an old-school loop. The first thing to note is that for collections the enhanced for loop uses an Iterator, so if you manually iterate over a … Read more