Result is false, but I get an error

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/courses/learn-java/lessons/conditionals-control-flow/exercises/boolean-operators-precedence?action=lesson_resume&link_content_target=interstitial_lesson

<In what way does your code behave incorrectly? Include ALL error messages.>
Almost! Did you use each Boolean operator no more than one time?’
It says “false” as the result, however, so that should be right.

```

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

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

}

}

<do not remove the three backticks above>

The culprit is the ! boolean and the only difference in my code compared to yours. You need to move it as it is not recognized there. I had mine outside like this:

= !( 1 < 8
1 Like

Thank you good sir. Much appreciated.

1 Like

No problem! Happy coding! :smiley:

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