Java Boolean Operators


#1



https://www.codecademy.com/en/courses/learn-java/lessons/conditionals-control-flow/exercises/boolean-operators-precedence


Almost! Did you use each Boolean operator no more than one time?


Replace this line with your code. 

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

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

    }
}


#2

> is used twice.


#3

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

Still getting the same error. :frowning:


#4

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

So seemingly you have to many () and I believe you need to call riddle instead of false


#5

Finnally, it's working. Thanks, :slight_smile:
Thanks to toplearner too for the reply.


#6

No problem hope the rest of your coding goes well! :smiley:


#8

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