• Post Reply Bookmark Topic Watch Topic
  • New Topic

Sales Program  RSS feed

 
Sam Pauken
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In this program, I having trouble creating my object and updating the number of sales that I have.





I have red Xs under lines 34 and 43.
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Where is your constructor defined?
 
Sam Pauken
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, geez. I knew that was going to be obvious. Still not sure how to update the sales though.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What should that do that the updateSales method doesn't do now?
 
Sam Pauken
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess that fixes it. Sorry. I've been doing programming all day so my brain is fried. Thanks for your help.
 
Campbell Ritchie
Marshal
Posts: 56584
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you using NumberFormat rather than the % tags?
 
Sam Pauken
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's the only way I know/have been taugh right now. What would that look like?
 
Campbell Ritchie
Marshal
Posts: 56584
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think NumberFormat became legacy code when the % tags were introduced, which was 9 years ago.
You can read about % tags in the Formatter class (possibly difficult reading) or the Java Tutorials in two places; 1 2; they call it formatting.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!