This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "help" Watch "help" New topic


Jade Davidson
Ranch Hand

Joined: Oct 12, 2001
Posts: 64
I must be overlooking something obvious, but I don't know why I am getting "else without if" compiler errors.

(edited by Cindy to format code)
[This message has been edited by Cindy Glass (edited December 14, 2001).]
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Go to the effort of including brackets even for single line statements, you'll save on so much stress in the long run.
Bit hard to see your layout since you didn't use the UBB [ code] tags, but I recommend lining up the start and end braces.

William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 986

First problem:

Second problem:

If you wrote this with 1] an editor that indented automatically, or 2] used {} correctly you would see the problem

Please ignore post, I have no idea what I am talking about.
Jade Davidson
Ranch Hand

Joined: Oct 12, 2001
Posts: 64
OK, I see it now. thanks.
Don't get me started about those stupid light bulbs.
subject: help
It's not a secret anymore!