Hello everyone, I just recently started studying
Java on my own using the book Head First Java and everything was going rather smoothly until the sixth chapter with the battleship-ish game, where I'm getting an error I have no idea how to fix since from what I know so far, the code's supposed to work.
I did check the web for the error and found some answers, however, most of them did not apply here (at least I don't think they do) since I'm declaring a method and the ones that were somewhat similar didn't work at all (for example, there was one that mentioned that the code given in the HFJ website worked once a line was fixed, but here it didn't work either.
For those familiar with the book, both the DotCom and GameHelper classes are on the same folder as the DotComBust and I typed them myself (they both compiled just fine).
And not sure if it makes any difference (shouldn't), but I'm doing all this on a mac, using the text edit to type all the code (but I have converted it to plain text instead of the default rich text).
Well, without further ado, here's the code:
And here's the error list:
The setName method refers to the DotCom class that is in another file at the same folder and is coded to take an
n String.