Saving the Objects in Java
Our programs reside on Hard Disk. Every program is brought into Main memory(RAM) for execution. Variables, Objects are runtime entity which means they are saved in RAM. Once you run the Program, variables, objects come into existence but once we close our program they are deleted from the Main Memory. In order to save the state(instance variable) of objects they must be saved on Secondary Memory(Hard Disk). Following are steps for serializing(saving) the objects.