AddressBook1.java:101: error: cannot find symbol
AddressBookTest addressBookTest1 = new firstName();
^
symbol: class firstName
How do I make the definition?
Pat Gareau wrote:I don't understand what I do with that sorry
In the Beginning Java forum, please be careful not to post "complete solutions," that is, something the OP can copy and paste into their code. Snippets are okay. This code comes close to being a complete solution. Instead, try to guide the OP to come up with their own solution.
.\AddressBook.java:18: error: ';' expected
String firstName
AddressBook1.java:23: error: cannot find symbol
return FirstName;
^
symbol: variable FirstName
.\AddressBook.java:18: error: ';' expected
String firstName
Carey Brown wrote:I'm still confused. Line 1 says "AddressBook1" and line 106 says "AddressBook", which is it? Have you created a class "AddressBook" somewhere else?
AddressBook1.java:23: error: cannot find symbol
return FirstName;
^
symbol: variable FirstName
Carey Brown wrote:
Carey Brown wrote:I'm still confused. Line 1 says "AddressBook1" and line 106 says "AddressBook", which is it? Have you created a class "AddressBook" somewhere else?
!!!
Delete all of your .class files and then recompile.
Pat Gareau wrote:I figured some things out now with your help thank you. I have a new problem though, I need to compare 2 names in my address book to see if they are the same or different. I wacthed a few videos on how to compare strings and I understand that concept. I am totally lost on how to compare strings using get and set and I tried for hours now. Please help I can't find anything online that explains this. Thank you very much.
Pat Gareau wrote:Thank you that clarifies a lot !
I have 2 .java files for this program. One
Is AddressBook1.java and the other is AddressBookTest1.java , which file so I add that information into? One had the main and the other doesn't . Thank you.
Pat Gareau wrote:Hello, i tried what you said, I must of done something wrong I got these errors.
All things are lawful, but not all things are profitable.
AddressBookTest1.java:12: error: cannot find symbol
System.out.println( Contact1);
^
symbol: variable Contact1
Pat Gareau wrote:Thank you so much everyone for helping me. The program complies and works now, but I am unable to get a specific field to printout, it just displays the whole contact info.
All things are lawful, but not all things are profitable.
Consider Paul's rocket mass heater. |