File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to deal with this error???

 
Jose Cisse
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1780
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of what class is method getDescription a member?
When you call getDesciption, to what object are you applying it?
 
Jose Cisse
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1780
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you invoking getName and getDescription in exactly the same manner?
 
Jose Cisse
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well~~~think so... ...

anyway, anyone can help me deal with this thing?
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


thx for your help, got it~~~
[ March 22, 2006: Message edited by: Jose Cisse ]
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cheers! I wasn't trying to be pendantic, but this saloon is built on the credo: Give a man a fish...
 
Jose Cisse
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic