Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

symbol cannot be found

 
corey williams
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jean-Francois Briere
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there classes that i have not created yet
 
Jean-Francois Briere
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
now what about my arraylist it gives me the same error for my arraylist
 
John Bartlett
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the code you have shown you have spelt ArrayList wrong....

John
 
corey williams
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i don't see the misspelling can you point it out to me please
 
John Bartlett
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error is here....



...

Change to:



John
 
Gabriel Fairbanks
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1274
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Gabriel Fairbanks
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1274
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... and String, in uppercase.

Arraylist<string> newLocation = helper.placeDotCom(3);
 
Burkhard Hassel
Ranch Hand
Posts: 1274
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey John Bartlett,
me and you are locking on the same object
this thread has to be
 
John Bartlett
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lol! yeah
 
corey williams
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic