GeeCON Prague 2014*
The moose likes Beginning Java and the fly likes how to deal with this error??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to deal with this error???" Watch "how to deal with this error???" New topic
Author

how to deal with this error???

Jose Cisse
Greenhorn

Joined: Mar 20, 2006
Posts: 28
at first, everything works ok, i got name of product and price...but later i want to add description of the product into this program...i thought the description should be smilar to the name...but

This is my InventoryItem class(after i put description into it) :
it actually can be compile successfully...

But in my Inventory class:


a error message coming out for "InventoryItem newItem = new InventoryItem(oldItem.getName(), getDescription(), price);"

it wrote" cannot resolve symbol-method getDescription()"

I am so confusing about this...anyone help me, plz~~~

many thx~~~
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
Of what class is method getDescription a member?
When you call getDesciption, to what object are you applying it?


There is no emoticon for what I am feeling!
Jose Cisse
Greenhorn

Joined: Mar 20, 2006
Posts: 28
Originally posted by Jeff Albertson:
Of what class is method getDescription a member?
When you call getDesciption, to what object are you applying it?

thanks for your reply~~~
i think i got "getDescription" in my InventoryItem class, right?
"Name" and "Description" are all kinds same, why "Name" can work properly, not "Description"???... ...
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
Are you invoking getName and getDescription in exactly the same manner?
Jose Cisse
Greenhorn

Joined: Mar 20, 2006
Posts: 28
well~~~think so... ...

anyway, anyone can help me deal with this thing?
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
In fact, I'm trying rather hard to help you. Look at the erroneous line of code again:

InventoryItem newItem = new InventoryItem(oldItem.getName(), getDescription(), price);

Are you calling getName and getDescription in exactly the same way?
Jose Cisse
Greenhorn

Joined: Mar 20, 2006
Posts: 28


thx for your help, got it~~~
[ March 22, 2006: Message edited by: Jose Cisse ]
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
Cheers! I wasn't trying to be pendantic, but this saloon is built on the credo: Give a man a fish...
Jose Cisse
Greenhorn

Joined: Mar 20, 2006
Posts: 28
Originally posted by Jeff Albertson:
Cheers! I wasn't trying to be pendantic, but this saloon is built on the credo: Give a man a fish...


thanks for your help~~~my brain was messed up at the moment~~~you carry me out from dark~~~lol
 
GeeCON Prague 2014
 
subject: how to deal with this error???