I want to save the objects I generated in a program. After restart the App should load automaticly all Objects in an Array. I want to write them in a file and parse them after restart. Are the other smarter possibilities than do it by hand? Thank you
You can use the Berkeley DB PersistentMap
class to save your (Serializable
) objects in a Map
implementation (a cache) which persists them to a file. It's pretty simple to use and means you don't have to worry about what to save where.
Three things to note about serialization: