11.Generalizations problem 2


#1

I am having a problem with the second problem... here is what I have...
public class GeneralizationsB {
public static void main(String[] args) {


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

boolean tricky = false;

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

	}

}

}


#2

Unclear what your problem is, but it doesn't compile so you will want to have a look at the compiler output

GeneralizationsB.java:5: error: not a statement
(( 3 >= 3) && !(true || true) )
^
GeneralizationsB.java:5: error: ';' expected
(( 3 >= 3) && !(true || true) )
                               ^
2 errors

#3

have you done this unit before?


#4

A post was split to a new topic: Problem here with the IF ELSE statements


#8

Estaba con ese ejercicio y lo que pasa es que después de pasar el punto 1, se debe poner de nuevo en comentarios // la linea 4 y 5 , para así poder continuar con el 2 y 3 sin que presente error


#9

Just don't remove 2 forward slashes and everyrhng will be Ok)


#10

thanks dude i wsa stuck on that for a while


#11

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