• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File wouldnt compile

 
Jose Kampilan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.

I'm currently having a problem with compiling an exercise from Head First: Java. I think all needed classes for the game to run have been compiled except for the main method.

Here's the main method (just copied it directly from the book):



And here's the error message from the compiler:



Not sure what i did wrong here.
 
Carey Brown
Bartender
Posts: 1680
22
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is main() enclosed in a class ?
 
Jose Kampilan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Carey Brown wrote:Is main() enclosed in a class ?


(Sorry. still new with Java.)

oh. i have to put it inside a class first? will try that.
 
Jose Kampilan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Huzzah. It worked.

Thanks Carey Brown.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic