• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Do anyone got these errors whiel compiling the code in page 148-149 in head First java??

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am getting more than 15 errors and using Netbeasn I got more than 20 errors??!! I combined the helper class also!!

All the errors are

DotComBust.java:18: cannot find symbol
symbol : class gamehelper
location: class DotComBust
gameHelper helper = new gamehelper();
^
DotComBust.java:39: cannot find symbol
symbol : variable dotComsList
location: class DotComBust
for (DotCom dotcomToSet : dotComsList)
^
DotComBust.java:48: cannot find symbol
symbol : variable dotComsList
location: class DotComBust
while(!dotComsList.isEmpty())
^
DotComBust.java:50: cannot find symbol
symbol : method getuserinput(java.lang.String)
location: class gameHelper
String userGuess = helper.getuserinput("Enter a guess");
^
DotComBust.java:67: cannot find symbol
symbol : variable dotcomList
location: class DotComBust
dotcomList.remove(dotcomToTest);
^
DotComBust.java:89: cannot find symbol
symbol : method setUpGame()
location: class DotComBust
game.setUpGame();
^
DotComBust.java:130: cannot find symbol
symbol : variable gridsize
location: class gameHelper
public int[] gird = new int[gridsize];
^
DotComBust.java:138: cannot find symbol
symbol : class InputSreamReader
location: class gameHelper
new InputSreamReader(System.in));
^
DotComBust.java:165: cannot find symbol
symbol : variable grid
location: class gameHelper
if(grid[location] ==0){
^
DotComBust.java:183: cannot find symbol
symbol : variable grid
location: class gameHelper
grid[coords[x]] =1;
^
DotComBust.java:108: cannot find symbol
symbol : method indexof(java.lang.String)
location: class java.util.ArrayList<java.lang.String>
int index = locationCells.indexof(userInput);
^
11 errors

Why are these errors occurring though the book is considered a good one???
 
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ashik, welcome to javaranch.

I don't think there is anything wrong with the book. I don't have the book so I can't predict what you have done wrong but if you could post the code that is producing the error, then it would be easier to help ...
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can also try to look at the code and correct some of your mistakes as f.ex.:

I guess there should be:

And remember that Java is a case sensitive language.
reply
    Bookmark Topic Watch Topic
  • New Topic