How can I serialize an ArrayList and Save it in a file?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The first thing you need to do is to serialize the class, the objects of which populate the ArrayList. If this is a simple class, composed mainly of primitive types and doesn’t have a deep structure, this will be easy. You can choose JSON, protocol buffers or even XML for the representation. If you succeed on this, it will be straightforward to serialize the ArrayList.