This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes Need help Getting error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Need help Getting error "illegal error:illegal start of expression"" Watch "Need help Getting error "illegal error:illegal start of expression"" New topic
Author

Need help Getting error "illegal error:illegal start of expression"

xiu vue
Greenhorn

Joined: Oct 28, 2009
Posts: 5
So I'm doing a lab for school and I keep getting illegal error: illegal start of expression. can someone please help me.
I posted the script below.


fbr - code tags added for readability
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18754
    
  40

xiu vue wrote:So I'm doing a lab for school and I keep getting illegal error: illegal start of expression. can someone please help me.


These types of errors are generally caused by a mismatch brace -- meaning you forgot to close an initializer, method, contructor, etc. And you are hence trying to declare a method inside another method, or something else that is not legal. Take the line number reported by the compiler and look around there, generally going backwards from that line is a good idea.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
xiu vue
Greenhorn

Joined: Oct 28, 2009
Posts: 5
Ok, Ill try that Thank You.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38459
    
  23
And welcome to JavaRanch

Please always tell us what the thread is about.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19674
    
  18

And also use code tags.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11250
    
  16

once the code tags are added, it's pretty easy to find the problem. you declare your constructor on line 11, but never close it. Then comes the start of a new method...


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help Getting error "illegal error:illegal start of expression"