Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Extreme beginner-code won't work  RSS feed

 
Clayton Easterbrooks
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am currently working my way through the head first java book and am completely stuck.
I am trying to write the mini battleship(re-written by me to involve the finding of a stolen Lamborghini)
game, and can't get it to compile right. I've gone over it for an hour straight and can't find what is wrong.


class 1:


class 2:


ERROR:


What am I doing wrong? Is it a typo that I haven't found?

Thanks
 
Rob Spoor
Sheriff
Posts: 21095
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseCodeTags next time. I've added both them and indentation for you.

StolenLambo does not have these methods; CheckLambo does. Perhaps you meant to turn line 5 into as CheckLambo does have them. Or perhaps you meant to make StolenLambo extend CheckLambo (thereby letting StolenLambo inherit the methods) and simply forgot.
 
Clayton Easterbrooks
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah ok I'll make sure to post code in that format from now on.


I figured it out. I simply put the CheckLambo code minus the class declaration inside
the StolenLambo class, inside only the class brackets. Works now. Thanks.

 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!