System for saving objects

Hi,

Java provides already a system for serializing objects :

You can look at this thread if you really want to save them in JSON format :

They talk about the GSON library which can serialize objects to JSON without writing annotations in the class (something you want to avoid).

And this tutorial can get you started with the library : https://www.studytrails.com/java/json/java-google-json-parse-json-to-java/

1 Like