Reputation: 57
I'm creating a program in which I need to store an item name, and a value. The program will randomly choose things from the list based on the total value being lower then a set limit, and then printing the names of those items. What would be the best file to store this in? I was looking at an .ini file, but that seems to be for settings and such. Any help would be greatly appreciated.
Upvotes: 0
Views: 778
Reputation: 38930
In that case, use XML and preferences.
Have a look at my post to set Preferences from XML : Loading a map using Properties class
Have a look at Example 1 and Example 2 links to write XML from java.
Upvotes: 0
Reputation: 6570
The typical key-value text file storage in Java is the Properties.
See an example here.
Upvotes: 4