File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Head First Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Head First Java" Watch "Head First Java" New topic

Head First Java

Ben Jones

Joined: Oct 04, 2007
Posts: 16
Hey all, I'm currently new(ish) to Java and I bought the above book (Head-First Java) and I've gotten on to the battleships game section.

However, when I declare a Array list of DotComs' I keep getting errors, I've been over the code about 4 times looking for mistakes I've made but I've corrected them and still the errors persist.

Has anyone else using this book managed to work out why this happends?

Dan Brownlow

Dan Brownlow
Joanne Neal

Joined: Aug 05, 2005
Posts: 3742
I haven't read the book, but from other posts on here I know some of the code samples are not complete. Check the text of the book to see if this is an example of that. You could also search these forums to see if other people have had similar problems. I think I remember the battleships program being mentioned before but I'm not sure what the exact problem was.
If none of that helps, post the error messages you are getting and the bit of your code they refer to and I'm sure someone will be able to spot the problem.

Amit M Tank
Ranch Hand

Joined: Mar 28, 2004
Posts: 257
If you write the code here, may be people will help you resolve the compile time issues.

Amit Tank
Linked In
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11955

also, post the EXACT text of the errors. that actually tells you what's wrong, once you learn how to read it (which isn't really all that hard).

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Ben Jones

Joined: Oct 04, 2007
Posts: 16
I went to the site and downloaded the JAR file and it didn't work, but after fiddling around for a while.. It's magically started working although I'm not 100% sure why. Yea', I know how to read the errors the compiler throws at me, spent a lot of time on google searching for what errors I got meant.

I'll keep trying to figure out what changed so if anyone has similar problems, they'll know how to fix it!
I agree. Here's the link:
subject: Head First Java
It's not a secret anymore!