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

File wouldnt compile

 
Jose Kampilan
Greenhorn
Posts: 11
  • 0
  • 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
Ranch Hand
Pie
Posts: 1070
11
Eclipse IDE Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is main() enclosed in a class ?
 
Jose Kampilan
Greenhorn
Posts: 11
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Huzzah. It worked.

Thanks Carey Brown.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic