Is this a problem or is it me? 5:12


#1



https://www.codecademy.com/en/courses/learn-java/lessons/conditionals-control-flow/exercises/boolean-operators-precedence?action=lesson_resume


It isn't saying an "error message" it's more of the website saying I'm wrong. I don't know if it's me or the website. I've went over this a lot and i can't seem to understand my problem or if I'm not clearly understanding the instructions. If anyone has advice please get back to me asap.


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

		boolean riddle = ( !( 1 < 8 || (5 > 2 && 3 < 5)) );
		System.out.println(riddle);

	}
}


#2

Did you add the outermost parentheses yourself? Some checkpoints (many in the Java track) compare your code to a regex pattern which has the effect that if you do anything that the author didn't anticipate then it'll no longer match


#3

I think i found my some how i wasn't supposed to add the extra parentheses. Wasn't i supposed to do that? I guess I'll go ahead and go with it.


#4

Well.. whether you're supposed to is really up to what you want your code to look like, personally I just find them to be redundant. They make no difference if that's what you mean.

As far as the exercises go, they'll give you the least trouble if you do only what the instructions suggest.


#5

You are exactly right, after i found the problem i finished the course and i do say it's getting more tricky.


#6

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