In this task I keep getting an error message. I'm confused where I should put the curly braces.
In this task I keep getting an error message. I'm confused where I should put the curly braces.
Under discussion
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
haayden
13 May, 13:39
For the ending curly braces, you don't put it before the thing you want to do, like the System.out.println() }, not } System.out.println(); Also, you put the starting curly brace ({) AFTER the condition, so it isn't
Think of the starting curly brace as the word "then", so you would do
Just so you know, for the else statement, there isn't a condition, so it's just else then, or
Hope I helped! If you need further explanation, i'll be happy to help. 0
Guadalupe Gagnon
10 May, 15:30
lines 16 and 17 are your problem. On line 16 there is an 'if' without a boolean statement. On line 17 there is a boolean statement without specification of what it is for. I think you meant for line 16 and 17 to be together, which is acceptable in Java as the compiler ignores white space, however the curly bracket at the end of line 16 is telling the compiler that they are not together.
0