Help me with GeneralizationsB.java


#1

I've just learned if, switch, boolean statements,Ternary Conditional in java.

The instruction is this.

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

And the code that is given is like below.

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

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

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!");
							break; 
		case 5 : System.out.println("This is a Brooklyn bound train!");
							break;
		case 7 : System.out.println("This is a Queens bound train!");
							break;
		default:
			System.out.println("I'm not sure where that train goes...");

	}

I don't know what the instruction want me to do.
Please help me!


#2

@pyace66873,
They want you to evaluate

( 3 >= 3 && !(true || true)

using the operator-precedence-table
https://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html
and everything between a pair of parentheses-( ) is processed as first.

If you figured it out
you will have to define Boolean tricky as a true or false


#3

Thxx!! I solved it :))