This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes File wouldnt compile Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "File wouldnt compile" Watch "File wouldnt compile" New topic
Author

File wouldnt compile

Jose Kampilan
Greenhorn

Joined: Aug 04, 2012
Posts: 11
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

Joined: Nov 19, 2001
Posts: 779
    
    2

Is main() enclosed in a class ?


When I was your age I was toggling in the bootstrap code on the front panel
Jose Kampilan
Greenhorn

Joined: Aug 04, 2012
Posts: 11
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

Joined: Aug 04, 2012
Posts: 11
Huzzah. It worked.

Thanks Carey Brown.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: File wouldnt compile
 
It's not a secret anymore!