<Below this line, add a link to the EXACT exercise that you are stuck at.>
<In what way does your code behave incorrectly? Include ALL error messages.>
I keep getting the message “Try again. The variable tricky should equal either true or false.” but I am setting tricky to equal true. What needs to be done is “Use the precedence rules to help you evaluate the Boolean expression in the single line comment above the tricky variable. Then, set the boolean variable tricky equal to the result (either true or false).”


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

// ( 3 >= 3 && !(true || true) )
boolean tricky	= true;	

if(2015 < 2016) {

		System.out.println("Stuck in the past...");

	}else {

		System.out.println("Upgraded to the future!");


int subwayTrain = 9;

	switch (subwayTrain){

		case 1 : System.out.println("This is a South Ferry bound train!");
		case 5 : System.out.println("This is a Brooklyn bound train!");
		case 7 : System.out.println("This is a Queens bound train!");
			System.out.println("I'm not sure where that train goes...");




<do not remove the three backticks above>

Tricky is not true.

3 >=3 (true) &&(and, for an and to be true both sides must be true)
!(not) (true ||(or) true)
true or true evaluates to true
we are left with
true && !(not)(true)
!true evaluates to false
leaving us with
true && false
Evaluates to false


Did you try,

if(tricky) {


1 Like

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