Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Errors in GUI program

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
David,
Thank you!
 
    Bookmark Topic Watch Topic
  • New Topic