The code came out right but the tutorial said I got it wrong


#1

I only used each Boolean operator one time like the tutorial said, but when I ran the program it said:

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

Even though I completed the exercise it won't let me move on.

Here is the link:

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

Here is what the code looks like:

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

#2

@elijahlawson

I'm sure this must not be an error because I've got the same code written in my code editor and it let me pass. I suggest refreshing webpage and resubmitting the same thing, it should work.


#3

Check the parentheses. !( 1 < 8 && (5 > 2 || 3 < 5));


#4

@pnaymik thank you very much. I had the same Problem with this exercise and your parentheses worked.
But why? What's wrong with that?


#5

There are too many sets of parentheses
Only two sets are needed.