aspose file tools*
The moose likes Beginning Java and the fly likes ; expected Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "; expected" Watch "; expected" New topic
Author

; expected

andrew cassato
Ranch Hand

Joined: Nov 14, 2010
Posts: 37
i am working on Selection Sort and I have a method which is returning the error "; expected" when the ; is there so I am not sure what I am doing wrong but creating this fraction is not working...


the error is on line 4 and 5, same problem.

thanks in advance
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3071
    
  33

You have a comma(,) at the end of line 3. Is it a typo? It would be better if you can provide the complete code.


Mohamed Sanaulla | My Blog
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18896
    
  40

andrew cassato wrote:
the error is on line 4 and 5, same problem.


Yea, sometimes these types of errors are caused by errors from previous lines. If the lines look okay, it's recommended to look a few lines back.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
andrew cassato
Ranch Hand

Joined: Nov 14, 2010
Posts: 37
Mohamed Sanaulla wrote:You have a comma(,) at the end of line 3. Is it a typo? It would be better if you can provide the complete code.


do'h. yea i took a variable out and forgot to remove the comma... weird that the error happens later.
thanks for your help
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

andrew cassato wrote:weird that the error happens later.

Not at all. The line ending with the comma is perfectly valid -- it could be continued with more comma-separated declarations on the next line. It's not until after that line that parser can possibly detect that something's gone awry.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
andrew cassato
Ranch Hand

Joined: Nov 14, 2010
Posts: 37
thanks for clearing that up
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ; expected