| Author |
symbol cannot be found
|
corey williams
Greenhorn
Joined: Jun 27, 2006
Posts: 26
|
|
|
everytime i write java code i get symbol cannot be found error message what does the erro mean and how can i fix it
|
 |
Joy Mookerji
Ranch Hand
Joined: Jul 26, 2006
Posts: 49
|
|
Can you give some detail of your error Then its easy to diagonize check PATH=C:\jdk1.4\bin CLASSPATH = C:\jdk1.4\lib\tools.jar;C:\jdk1.4\jre\lib\rt.jar
|
SCJP 5<br />Brainbench Certified in C++<br />PMP<br />Dallas,TX
|
 |
Jean-Francois Briere
Ranch Hand
Joined: Mar 03, 2004
Posts: 101
|
|
|
Could you post the relevant part of the code and the exact error message output please so we'll be able to help you.
|
 |
corey williams
Greenhorn
Joined: Jun 27, 2006
Posts: 26
|
|
i'm useing netbeans import java.util.*; public class DotComBust { private GameHelper helper = new GameHelper(); private ArrayList<DotCom> dotComList = new ArraryList<DotCom>(); private int numOfGuesses = 0; /** Creates a new instance of DotComBust */ private void setUpGame() { DotCom one = new DotCom(); one.setName("Pets.com"); DotCom two = new DotCom(); one.setName("eToys.com"); DotCom three = new DotCom(); one.setName("Go2.com"); dotComList.add(one); dotComList.add(two); dotComList.add(three); System.out.println("Your goal is to sink three dot coms"); System.out.println("pets.com, eToys.com, Go2.com"); System.out.println("Try to sink the all in the fewest number of guesses"); for (DotCom dotComToSet : dotComList) { Arraylist<string> newLocation = helper.placeDotCom(3); dotComToSet.setLocationcells(newLocation); } } i'm getting the error on the decliration og the arraylist and also for my gamehelper object, and for the dotcom objectt that i create, and the error say that it can't find the symbol, and then it tells me the symbol and the location
|
 |
Jean-Francois Briere
Ranch Hand
Joined: Mar 03, 2004
Posts: 101
|
|
Are the DotCom and GameHelper classes part of your project? Or are those classes from an external jar file? [ September 21, 2006: Message edited by: Jean-Francois Briere ]
|
 |
corey williams
Greenhorn
Joined: Jun 27, 2006
Posts: 26
|
|
|
there classes that i have not created yet
|
 |
Jean-Francois Briere
Ranch Hand
Joined: Mar 03, 2004
Posts: 101
|
|
Then this is clearly the reason why the compiler cannot find the symbols DotCom and GameHelper isn't it? Simply creates the classes with the appropriate methods even though there is no implementation in the methods. For instance: Regards
|
 |
corey williams
Greenhorn
Joined: Jun 27, 2006
Posts: 26
|
|
|
now what about my arraylist it gives me the same error for my arraylist
|
 |
John Bartlett
Ranch Hand
Joined: Jan 25, 2006
Posts: 116
|
|
In the code you have shown you have spelt ArrayList wrong.... John
|
 |
corey williams
Greenhorn
Joined: Jun 27, 2006
Posts: 26
|
|
|
i don't see the misspelling can you point it out to me please
|
 |
John Bartlett
Ranch Hand
Joined: Jan 25, 2006
Posts: 116
|
|
The error is here.... ... Change to: John
|
 |
Gabriel Fairbanks
Greenhorn
Joined: Jul 30, 2004
Posts: 4
|
|
i don't see the misspelling can you point it out to me please
The misspelling is in: You have to use "ArrayList" instead of "Arraylist".
|
 |
Burkhard Hassel
Ranch Hand
Joined: Aug 25, 2006
Posts: 1274
|
|
Hi! Arraylist<string> newLocation = helper.placeDotCom(3); ArrayList, not Arraylist. BTW, are you sure you are using java5? Generics won't work with earlier versions. Bu.
|
all events occur in real time
|
 |
Gabriel Fairbanks
Greenhorn
Joined: Jul 30, 2004
Posts: 4
|
|
The error is here.... code: private ArrayList<DotCom> dotComList = new ArraryList<DotCom>(); ... Change to: code: private ArrayList<DotCom> dotComList = new ArrayList<DotCom>(); John
Oops... I think I've found another one instead hehehe
|
 |
John Bartlett
Ranch Hand
Joined: Jan 25, 2006
Posts: 116
|
|
Lol yeah i think there are a few around, just found another little thing in the: You also have appeared to have used string instead of String, that will also need to be corrected. John [ September 22, 2006: Message edited by: John Bartlett ]
|
 |
Burkhard Hassel
Ranch Hand
Joined: Aug 25, 2006
Posts: 1274
|
|
... and String, in uppercase. Arraylist<string> newLocation = helper.placeDotCom(3);
|
 |
Burkhard Hassel
Ranch Hand
Joined: Aug 25, 2006
Posts: 1274
|
|
Hey John Bartlett, me and you are locking on the same object this thread has to be
|
 |
John Bartlett
Ranch Hand
Joined: Jan 25, 2006
Posts: 116
|
|
|
Lol! yeah
|
 |
corey williams
Greenhorn
Joined: Jun 27, 2006
Posts: 26
|
|
|
ok thanks
|
 |
 |
|
|
subject: symbol cannot be found
|
|
|