File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion 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.
I agree. Here's the link:
subject: help
It's not a secret anymore!