GeneralizationsB.Java Beginner Problem


#1



I'm having what is probably an easy fix for most of you, but I am stuck on this one. How is the first line in this exercise supposed to go?

https://www.codecademy.com/en/courses/learn-java/lessons/conditionals-control-flow/exercises/generalizations-conditionals?action=resume


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 = true;


#2

This expression it's not a statement because nothing is being done with it. The way it's written is like a vague information. So you need to do something with it to be considered a statement. Try to store the result of this expression in a variable. See you!


#3

Here are my instructions:
Use the precedence rules to help you evaluate the Boolean expression in the single line comment above the tricky variable.

Then, set the boolean variable tricky equal to the result (either true or false).

My code is me trying to do that, can someone explain to me how to do that? Please?


#4

Hey man I was dealing with the same problem, I failed to notice the !true making the statement false. Change that statement back to a single line comment //(statement) then make Boolean tricky = false


#5

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