I'm making a game where you can get coins, highscore etc. and keep them without setting it back to default when I exit and close the game. May I know how to do this?
Asked
Active
Viewed 44 times
0
-
You can save your stuff in databases or in files for example. See this [stackoverflow post](http://stackoverflow.com/questions/1955396/whats-the-easiest-way-to-persist-java-objects). – Stefan Lindner Apr 04 '17 at 06:27
-
Use a file or store the values in Database. – Pooja Arora Apr 04 '17 at 06:27
2 Answers
0
If you want the state to be restored even after your program exists and runs again, below are the options-
- Store the data in DB
- Serialize in the file system
- Store the data on disk

Jaydeep Rajput
- 3,605
- 17
- 35