Help:::why it does not work?

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

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



it always show me : Almost!Did you use each boolean operator no more than one time …

It won’t work because you are trying to print out a boolean. A boolean is either true of false. The easiest way to print out a boolean is to create an if else statement like the following:

} else {

This tells your program to print out True in case riddle is set to true and to print out false in case riddle is set to false

1 Like