Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MainApplication {
- public static void main(String[] args) {
- // Exemplo de while.
- int contador = 0;
- while(contador <= 10) {
- //System.out.println("Loop: " + contador);
- contador ++;
- }
- // Exemplo de do while.
- contador = 0;
- do {
- //System.out.println("Loop: " + contador);
- contador ++;
- } while(contador <= 10);
- // Exemplo de for.
- for (int i = 0; i<=10; i++) {
- System.out.println("Loop: " + i);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement