• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Error message

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am down from 21 errors to 1 error. Keep getting an ; expected error message but when I put it in it creates more errors. Error is on line 162. Any help would be appreciated. Here's my code


Thank you in advance for the help.
 
Ranch Hand
Posts: 82
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Public MusicCDInventory() try public MusicCDInventory()
 
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
When I change the capital p to a lowercase p it tells me it is an illegal start of expression and gives me the 2nd error as ; expected. I am becoming totally confused on this.

Thank you for your help.
 
Ranch Hand
Posts: 1296
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why is that line in there at all? First of all it's not valid Java syntax, and second of all you're attempting to call the constructor (I think) of MusicCDInventory from within the constructor of MusicCDInventory. I think you need to take a step back from the code, and consider what it is you're trying to do, and how all the pieces fit together.

One piece of advice I would give is don't try to code up your entire application, and then try to compile and debug it. Try more frequent compile schedule like:

  • Add a small bit of code
  • Compile
  • Fix any compile errors (if present)
  • Write some code to test the code you just compiled
  • Fix any logic errors
  • Repeat


  • When I say a small bit of code I literally mean no more than 3 - 5 lines.
     
    pie. tiny ad:
    Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    reply
      Bookmark Topic Watch Topic
    • New Topic