• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

text data files

 
Nazma Panjwani
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • 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.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • 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.
 
Shashank Agarwal
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic