5: Almost! Did you use each Boolean Operator only one time?


#1

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

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

}

}

^ It prints out false. Why does it not work then?


#2

It should look like this:
public class Precedence {
public static void main(String[] args) {

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

}

}
Hope this helps


#3

Thanks, but why did you remove the parantheses from (1<8). Please explain.


#4

no resulta
eh intentado de casi todas las formas pero no sale me podrian ayudar¿?


#5

3 posts were split to a new topic: A little confused by this. Can someone correct my logic?