I am developing an application in Java, where I have some classes, like Person
and Company
. All these classes have some instances e.g.
public class Person{
private String firstName;
private String lastName;
private String mail;
//more code..
}
So in some point I create an Object type of Person, which I want to save it for future use. I am new to this, so I have this question. Should I use Object serialization or should I save it in XML format? I realize that an XML format has its advantages that's why I am asking (If I want to save it in XML format, I use XMLEncoder
class right?) Which one should I use?