Help! I keep getting an error message at line 23 that says else is not a statement. What should I change or how do I fix this?
Thanks!
Help if else statement error message - error message at line 23 that says else is not a statement
Under discussion
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
DavidarCZ
11 May, 00:11
one problem is the not closed curly brace Coboliste described however I believe the error is because of the condition after 'else'. We do not use condition after else because it is already negation of the original condition of 'if'. If you want to use it with condition anyway you can use 'else if'
0
Coboliste
9 May, 16:54
Hello Alana,
1- Add a closed curly brace after System.out.println(cold);
or
2- remove the opened curly brace before System.out.println(cold);
and the curly braces before and after System.out.println(warm);
0