Forums Register Login

Head First Java Problem

+Pie Number of slices to send: Send
Ok guys... ive been struggling witht his for a few hours now.... and i dont have much hair left.

I have copied the code for the "battleships" game out of head first Java... and checked it.... and checked it... and checked it again.

I cant get one of the classes to compile... and i cant see why.

I went to the Sun forums, and saw the exact same prolemn someone else was having... and they just got abused, called stupid, and told to do some research ... so please..... dont be mean to me... im trying my hardest.

here is the block of code that wont compile.



this gives me 13 identical errors refering to different parts of my code, reading : "class, enum or interface expected"

Can anybody save my hair before i need a toupe please??

thanks in advance chaps and chapettes
+Pie Number of slices to send: Send
Right.... ive got it working.... i put the main() method inside a class and it compiled straight away... however.... i could not get the following code to compile, even when i put it in a class:



howecer...... despite this file NOT compiling, it seems to be required for the program to run, if its not in the directory with the class files then the program throws a runtime error, but if it is there (even uncompiled) everything goes smoothly.

This is really messing my head up now.

Does this means ome files do not need to be compiled in oprder for them to work ?
+Pie Number of slices to send: Send
bah ! ignore me.... i must have done something wierd... it all seems to work properly now
We should throw him a surprise party. It will cheer him up. We can use this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 940 times.
Similar Threads
HFJ 2nd - Problem with SimpleDotCom
Head first java - chapter 5 SimpleDotCom game
First question in Beginners forum ...
HeadFirst DotComBust... Help?
Help with code
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 13:58:22.