11.Generalizations


#1

What is wrong with this code?


#4

I had it do the same thing to me, switched it to true still didn't work then back to false and it worked. not sure what's up, must be a bug.


#5

hi,
change the following line in this code

int subwayTrain =9;

to either 1,5,or 7


#6

This code worked to get the first instruction PASS

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

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

#7

I am not getting the second instruction executed..i dont know what is wrong? :frowning:


#8

same here, seems like a bug!


#9

i got it :slight_smile:see, if this helps ...
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 = 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...");

	}

}

}


#10

thats exactly how I had it, somehow it would not work, but now it does... guess I had to let it cool off for a night haha thanks anyways mate.


#11

lol..okay..yoo buddy !! :wink:


#12

3 posts were split to a new topic: 11. It's not working for me


#15

Thank you so much!!!!! was working for hours on that one thing!! I understand now!!


#16