• 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
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

text data files

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys,
Please tell me what I am doing wrong,
I created an input file, called inventory.dat, saved in under the same package, as the following class, please see the code blelow,
basically, the programs reads an input from the file, makes objects, saves them in an array, and prints them; the input file just has
item, units and price llisted on each line. I dont have any syntax errors, the programs runs properly, but there is not output produced. Is it
not reading from the file??? It is not even throwing any exceptions.

Thanks.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You may want to print out each "line" to see what progress is being made.

In the future, please UseCodeTags when posting code of any length. It's unnecessarily hard to read the code as it is, making it less likely that people will bother to do so.
 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess the problem is in line 44 inventoryItem[scan], although you might first want to ensure that all lines are read properly, as suggested by the other poster.
 
roses are red, violets are blue. Some poems rhyme and some are a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic