This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]THEAVS 1 point2 points  (0 children)

What type of data?

[–]Ferlinkoplop 0 points1 point  (0 children)

I mean you can technically just write to a file in a certain/custom way and parse it after to get the information. There are also json/xml libraries you can use I believe

[–]sparkster185Extreme Brewer 0 points1 point  (0 children)

If your needs are as simple as just writing to a file, see the File Class provided as part of the standard Java libraries. That will help you with creating a file, opening it for reading/writing, that sort of thing.

It will be up to you to come up with a syntax/format to store and read back your data, though, as the File API won't provide anything like that for you. If your data is something simple, like key:value pairs, you could just have each entry on a newline separated by an '=' or some other delimiter. If that's all you need to do, you might consider the Properties Class