Java for each Loop
The for-each loop, also known as the enhanced for loop, is a control flow statement that allows you to iterate over the elements of an array or a collection in Java. It’s a looping statement that allows you to execute a block of code repeatedly for each element in the array or collection. The for-each…