title: Best method to write objects to a text file
body: <p>I want to know what would be the best way to save objects to a file ? Saving in the sense, the objects need to be appended. 
  When i searched the internet i found that printwriter saves an object in the format of it's toString method, but then if it saves an object to a file in the toString format , how can the programer use it to access an instance in an object. 
  What i mean is, if i save a student object to a text file using printwriter(The object has a name, id and age) , how can i use it in the future to compare the age of one student with another student's age / search by id , etc. 
  Since the object is saved as a string , it can only be read as a string so how can i access the instances of an object?</p>
  
  <p>The other method i found out is serialization. Serialization looks like it does the job but then i found out that it cannot append objects to a file , because it's stream header keeps on overriding. Is there a method to append objects to a file using serialization ?</p>
  
  <p>Currently these are the only 2 methods i found out for writing objects , but it seems i cannot use any of these methods since when saved using printwriter , it will be read as a string and if i use serialization i can store only one record.</p>
  
  <p>Thank you for your time.</p>