Plese help JAVA Bolean not working
Go to solution
Solved by Eigenvektor,
That code seems pretty complicated for what you're asked to do. How about using AND (&&) and OR (||), rather than XOR?
final boolean isCold = input.nextBoolean(); final boolean isDry = input.nextBoolean(); // For less mind-fuckery final boolean isHot = !isCold; if (isHot) { System.out.print("It is hot\n"); } if (isDry) { System.out.print("It is dry\n"); } if (isHot || isDry) { System.out.print("It is hot or dry\n"); } if (isHot && isDry) { System.out.print("It is hot and dry\n"); }
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now