What's wrong?


#1

What's wrong?

public class Precedence {
	public static void main(String[] args) {
//merhaba
	boolean riddle = !(true) && ( 1 < 8 || true) && (5 > 2 && 3 < 5);
		System.out.println (riddle);

	}
}

The three Boolean operators &&, ||, and!
#2

Given the following,

boolean riddle = /**/( 1 < 8 /**/ (5 > 2 /**/ 3 < 5));

we are asked to add in the missing logic operators such that the riddle has a value of false. The simplest way to approach this is to make everything inside the outer brackets evaluate to true, then negate it.

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

There are other approaches, but we should be sure to leave the expression intact, and not add any new values or expressions. Just work with what is given.