+ 1
Enhanced for loop vs foreach loop?
I was in AP computers today and we learned about the foreach loop. When I saw it I instantly thought it was the enhanced for loop. They seem to have the same syntax. What's the difference?
1 Resposta
+ 1
With foreach you don't need to access the elements of an array with its index