Generalizations


#1

https://www.codecademy.com/courses/learn-java/lessons/conditionals-control-flow/exercises/generalizations-conditionals?action=lesson_resume&link_content_target=interstitial_undefined

Instructions were to " set the boolean variable tricky equal to the result (either true or false)." but it gives me an error message even though my code prints the message in the else block.

EDIT: here’s the whole code

====Try again. The variable tricky should equal either true or false.====

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

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

	if(tricky) {

			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

2 posts were merged into an existing topic: Java : Generalisations


#3

#4

Without paying specific regard to syntax, we cannot explore further any problems that might exist. There are definite syntactical deficiencies, to be sure.


#5

That means literally, not by means of the expression.