File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
xiu vue
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 20833
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
xiu vue
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, Ill try that Thank You.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47232
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to JavaRanch

Please always tell us what the thread is about.
 
Rob Spoor
Sheriff
Pie
Posts: 20372
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And also use code tags.
 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12017
24
Chrome Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic