Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class OperadoresLogicosNot {
- public static void main(String[] args) {
- boolean x = false;
- boolean y = true;
- boolean resultado = ((!x==true)); //DECIMOS QUE X NO ES IGUAL A TRUE.
- System.out.println(resultado); // X NO = TRUE Y EL VALOR DE Y = FALSE POR LO TANTO IMPRIMIRÁ VERDADERO (TRUE)
- resultado = ((!y==true)); //DECIMOS QUE Y NO ES IGUAL A TRUE.
- System.out.println(resultado); //Y NO = TRUE Y EL VALOR DE Y = TRUE POR LO TANTO IMPRIMIRÁ FALSO (FALSE)
- }
- }
Add Comment
Please, Sign In to add comment