Serialization is a mechanism of converting the state of an object into a byte stream. Deserialization is the reverse process where the byte stream is used to recreate the actual Java object in memory. This mechanism is used to persist the object. interface

The next example show how to apply this in object class :

public class Person implements Serializable{  
 int id;  
 String name;  
 public Person(int id, String name) { = id; = name;  

Laisser un commentaire