my dog learned polymorphism*
The moose likes Beginning Java and the fly likes Need help with Java, cannot find symbol class? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Need help with Java, cannot find symbol class?" Watch "Need help with Java, cannot find symbol class?" New topic
Author

Need help with Java, cannot find symbol class?

beu curt
Greenhorn

Joined: Jan 16, 2010
Posts: 18
The program is an Address Book. and I cant get rid of the "cannot find symbol class" error, what should I do?

here is the code:



Here is the error:
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

The compiler does not find the AddressBookEntry class because it's not in the CLASSPATH
1. Where is AddressBookEntry.class ?
2. How did you compile AddressBook ?

[My Blog]
All roads lead to JavaRanch
Pushkar Choudhary
Rancher

Joined: May 21, 2006
Posts: 425

Is your AddressBookEntry class in the same package as the AddressBook class? If not, you need to import it.
Pushkar Choudhary
Rancher

Joined: May 21, 2006
Posts: 425

Ohh.. Beaten by 11 seconds...!!!
Christophe Verré, I'm sure your network is faster than mine.
beu curt
Greenhorn

Joined: Jan 16, 2010
Posts: 18
Christophe Verré wrote:The compiler does not find the AddressBookEntry class because it's not in the CLASSPATH
1. Where is AddressBookEntry.class ?
2. How did you compile AddressBook ?


A big noob here, can't understand what you are trying to explain.
sorry
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39884
    
  28
Please find the class whose name you are getting the problems with, and tell us exactly where you have got the .class file.
beu curt
Greenhorn

Joined: Jan 16, 2010
Posts: 18
Campbell Ritchie wrote:Please find the class whose name you are getting the problems with, and tell us exactly where you have got the .class file.


This is the whole program. I posted everything.

I think the problem is line number 8:

salvin francis
Ranch Hand

Joined: Jan 12, 2009
Posts: 928

well...

Take a look at the program written...

it requires two different classes : AddressBook and AddressBookEntry

You have provided code that shows the defination of AddressBook,
but where is AddressBookEntry ?
thats what the java compiler is saying:

"cannot find symbol class AddressBookEntry"

let me rephrase/interpret that:

"Dude, I want to run your program, but I am unable to find a class named 'AddressBookEntry'. Its probably in a file called AddressBookEntry.java,
have you forgotten to define such class? if you have defined it, is it in the same class path so that I may access it ?"




My Website: [Salvin.in] Cool your mind:[Salvin.in/painting] My Sally:[Salvin.in/sally]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help with Java, cannot find symbol class?