Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
xiu vue
Greenhorn
Posts: 5
  • 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: 21116
78
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, Ill try that Thank You.
 
Campbell Ritchie
Sheriff
Pie
Posts: 48940
60
  • 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: 20527
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And also use code tags.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12123
30
Chrome Java Linux
  • 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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic