Is there an easy way to save data?
In school, I'm taking a java independent study course, so all of the software downloading and whatnot is managed by the network technician. All that I have access to is iTerm on a mac, which has a compiler and all the basic necessities of programming already installed on it. The other person in my class and myself were wondering if there was an easy way to store data entered by the user to another file, which can be loaded up and used by a program when it's started. For example, if I were to write a program that asks the user to enter questions and the correct answer to the questions, and then begins randomly choosing questions that the user entered to quiz him on, would it be possible to easily store the questions so that they don't have to be re-entered each time the program is started? Unfortunately, we don't have the ability to use SQL or any database of that sort, so we're trying to create a makeshift one ourselves.
Re: Is there an easy way to save data?
You could write you data out as plain text to a text file using FileWriter. Or you could have your classes implement Serializable and save the objects using ObjectOutputStream.