Created
June 17, 2021 16:58
-
-
Save filiperdt/e3454c8b592988a9ab07d2047da351de to your computer and use it in GitHub Desktop.
Formas de for each no Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// for each 1 | |
for(Mensagem mensagem : mensagens){ | |
System.out.println(mensagem); | |
} | |
// for each 2 - Utilizando função | |
mensagens.forEach(mensagem -> { | |
System.out.println(mensagem); | |
}); | |
// for each 3 | |
mensagens.forEach(System.out::println); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment