Last active
June 30, 2018 04:25
-
-
Save dariogabriel113/37e14f78efcaf45b8968ebd53511d560 to your computer and use it in GitHub Desktop.
Testando if e else
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
public class TestaCondicional { | |
public static void main(String[] args) { | |
System.out.println("testando condicionais"); | |
int idade = 18; | |
int quantidadePessoas = 3; | |
if (idade >= 18) { | |
System.out.println("Você tem mais que 18 anos"); | |
System.out.println("Seja bem vindo"); | |
} else { | |
if (quantidadePessoas >= 2) { | |
System.out.println("voce não tem 18, mas pode entrar, " | |
+ "pois está acompanhado"); | |
} else { | |
System.out.println("infelizmente voce nao pode entrar"); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment