Concept
Utility
Syntax
for (tipo elemento : coleção) { // bloco de código }
Example
int[] numeros = {1, 2, 3, 4, 5}; for (int numero : numeros) { System.out.println(numero); }
Advantages
Additional Discussion
The improved for loop will be discussed in more detail in Chapter 5, after the introduction to arrays.
The above is the detailed content of The Lasso is Improved. For more information, please follow other related articles on the PHP Chinese website!