r/CodingHelp • u/FriendsMadeMeBeAnon • Sep 06 '19
[Java] Whats wrong with this else statement, I'm about to rip my dick off
12
u/saucyrosssy Sep 06 '19
Semicolon strikes again!!
2
u/retardrabbit Sep 07 '19
Why is the IDE giving such a shit error message though. That's like, static code analysis 101, not very helpful IMHO.
Looks like it's some specialized IDE though.
4
u/midwestraxx Sep 07 '19
Because it is an else without an if operationally. The if is contained in one line. Better than only "syntax error"
1
u/retardrabbit Sep 07 '19
Yeah, I guess that if statement (without the following bracketed block and the rose statement) would compile wouldn't it.
Good catch..
2
u/Famous_Profile Professional Coder Sep 07 '19
Exactly
Btw the error is from the compiler, not the IDE
2
2
1
u/SupremeRedditBot Professional Bot || Mod Sep 06 '19
Please Add A Flair To Your Post!
Suggested Flair: [Random] or [Meta]
To add a flair:
Click
flairunderneath your postSelect a flair
Click
save
I am a bot run by /u/SupremeDesigner for /r/CodingHelp || This was an automated ^response
18
u/_DTR_ Professional Coder Sep 06 '19
You have a semicolon after your
ifstatement, which essentially turns it into an if statement without a body. Formatted differently, what you have is