• Post Reply Bookmark Topic Watch Topic
  • New Topic

Method problem...  RSS feed

 
Martin vanPutten
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use to do this no problem... but I havn't used java in a little while. Whats wrong with this method, and why don't it work the way it is now?



Here is the entire code:
 
Dani Atrei
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't used java for a while either but looks like that method is inside another method, if I recall, that's not legal. What's the error message?
 
Martin vanPutten
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"illegal start" - I tried it outside of the method but i get the same error.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, certainly the problem that jumps out at me is that the method is nested inside another, which is not allowed. If you move this so that it's inside the "class" braces, but outside of any method -- i.e., move it so that it's in betwen the very last two braces in your listing below -- then you certainly won't get the same error, although there might be other errors we're missing.

When asking for help with a compiler message you don't understand, it helps tremendously if you tell us the whole message, which includes exactly which line ie referred to, and the whole text. Cut-and-paste is the best.
 
Manuel Moons
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Move the "slowMoveVerticle". It can not be defined inside the constructor.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!