I have used Boolean operator no more than once to replace the empty comments /**/. The code statement also printed out false. But, still the error message is popping up


#1

<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.>

```

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

<do not remove the three backticks above>

#2

There may only be one way that the SCT recognizes as the path to a false result. Check out the following spoiler…

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

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

		// ( !true || (false && true) )
		boolean puzzle = false;
		System.out.println(puzzle);
		
	}
}

#3

Thanks a lot. But the output section of the page was displaying “false”. I thought that should be correct as well. Thanks Again. :slight_smile:


#4

Submission Correctness Test - A small program behind the lesson but in the same context so it can see the code and console output. These programs are not very exhaustive and may only accept one of several possible correct responses.


#5

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