File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes If Statement Help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "If Statement Help" Watch "If Statement Help" New topic
Author

If Statement Help

Raymond Owens
Greenhorn

Joined: Jun 16, 2009
Posts: 7
New to programming...trying to teach myself Java using (mostly) Objects First With Java.

Having trouble with an "if" statement in the exceedsBudget method. The compiler is returning a missing ";" error but I know there should not be a semi @ the end of the method header.

Thanks for any assistance!



[HENRY: Edit quote to code tags]
John de Michele
Rancher

Joined: Mar 09, 2009
Posts: 600
Raymond:

Welcome to JavaRanch!

Your problem resides on line 58.

John.
Raymond Owens
Greenhorn

Joined: Jun 16, 2009
Posts: 7
John.....

I guess that's what happens when you stare at the same five lines of code for 20 minutes. Seems very obvious now .

Now that the code will compile without errors, BlueJ will not allow me to make a call (it's not even listed) to this same method. The syntax is the same as the insertMoney method which I can call up without issues.

Thanks so much for the help....

Ray
John de Michele
Rancher

Joined: Mar 09, 2009
Posts: 600
Raymond:

It may be because line 59 is ambiguous. I haven't used BlueJ, so I don't know its quirks, but it may be having issues with the fact that you have a class member called 'budget' and a local variable called 'budget'. Try renaming the variable at line 57 and change the variable name on line 59 to match it, and see if you can use the method then.

John.
Raymond Owens
Greenhorn

Joined: Jun 16, 2009
Posts: 7
I think it must be an issue with BlueJ. I did as you suggested but no luck. Code compiles ok but the method still is not available to call.
Raymond Owens
Greenhorn

Joined: Jun 16, 2009
Posts: 7
Found it......

Typo when closing the comments....had the * and the / reversed which commented out all of the code.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: If Statement Help
 
Similar Threads
question in a beginning java problem
Illegal start?
Asking for help! Dont understand this code
toString method in vector.
Thread + inner class + wait + notify + if + while ???