What is the problem here? 10:11 Generalizations


#1

Here is my code but it just keeps saying "Try again. The variable tricky should equal either true or false":

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

// ( 3 >= 3 && !(true || true) ) 
boolean tricky = (3 >= 3 && !(true ||true));
System.out.println(tricky);

if(2015 > 2016) {

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

    }else {

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

    }


int subwayTrain = 5;

    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...");

    }

#2

@easy_sailing,
They want you to manually resolve the expression

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

thus use

boolean tricky = false;

#3

ya same here...wen i too typed the same code i got d same wrds try again...


#4

hi, i don't understand this question
what is the purpose of this question?

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


#5

sir, you just saved my day (or say half of night?)

Muchos gracias!

I've tried the same thing as the guy who started the thread, and other stuff, but nothing seemed to work!

How I'm brand new to this, sometimes I have to read a couple of times the requirement to understand it!


#6