11/11 - Generalizations


Hi Guys, need your help.

For some reason my code is not working and i keep getting the below error message, weird thing on the second part of the exercise I did not change the code and it run correctly, so i dont understand what was the main objective of that section.


GeneralizationsB.java:4: error: not a statement
(3 >= 3 && !(true || true));
1 error

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


Thanks for the help.


As it says, that isn't a statement. Consider what it was meant to do and how that something looks like - possibly you will want to look up how to do that something, but either way you'll have to start by figuring out the intention of that code.


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