• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Errors in GUI program

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a program for class that has 6 parts to it. I got all of them working except the GUI part. I keep getting two errors that repeat in the code. Could someone please explain what these errors mean and how can I fix them? Here is my code:


The errors on lines 247, 289, and 480 are: setMusicCD(int, MusicCD) in MusicCDInventory can not be applied to (int,CD)
The errors on lines473 and 499 are: incompatible types found : MusicCD location CD return new MusicCD(cDName, struPCNumber, genre, units, unitPrice);

Thank you in advance for any help you can give me.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's a mighty long method.

247/etc. is a class cast problem: I'd guess (and w/o the rest it's just a guess) that the MusicCDInventory is expecting only MusicCD parameters, whereas you're trying to pass it a CD.
 
Candie Duggan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
David,
Thank you!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic