Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Head First Java

 
Ben Jones
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you write the code here, may be people will help you resolve the compile time issues.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12127
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Ben Jones
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic