Boolean Operators


#1



https://www.codecademy.com/courses/learn-java/lessons/conditionals-control-flow/exercises/boolean-operators-precedence?action=lesson_resume

the code is asking me to use the 3 boolean operators and make the expression result in false, but i can't get it to work.


public class Precedence {
	public static void main(String[] args) {

		boolean riddle = !( 1 < 8)  && (5 > 2) || (3 < 5));
		System.out.println(riddle);

	}
}


#2

well first off, as far as I can tell there was never a ) after 1 < 8. I think that somehow snuck in there.

Look at the order these two are in. One simple switch can change how everything is viewed in a code!


#3

the code is asking me to use the 3 boolean operators and make the expression result in false, but i can't get it to work. please assist me Code Academy.

public class Precedence {
public static void main(String[] args) {

	boolean riddle = !( 1 < 8)  && (5 > 2) || (3 < 5));
	System.out.println(riddle);

}

}


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.