Java : Generalisations


#1

The Exercise “Generalisation” always show error even though i have written the code correctly ;

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

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

	if(tricky) {

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

		}else {

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

		}

The output screen is displaying the output as desired by the instruction, yet the error message is appearing


Generalizations
#2

The closing braces are missing for the main method and for the class. Perhaps that is the issue?

Aside

Please remember to include a link to the exercise in your topic post. It helps us make a bee line to the lesson and ensures we are on the same page. Thanks.

Generalizations


#5

I think the following is false

so they wanted you to print the code in the else block


#6

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