package test; /** * Test the serialization in Java * *@author Didier Donsez *@version 1.0 (without setter methods) */ public class Person implements java.io.Serializable { private String firstname; private String lastname; transient private int age; // this field is transient : it is not serialized private String[] phones; // default constructor is mandatory for deserialization process public Person(){ } public Person(String firstname, String lastname, int age, String[] phones){ this.firstname=firstname; this.lastname=lastname; this.age=age; this.phones=phones; } public String toString(){ StringBuffer sb=new StringBuffer(); sb.append("My name is ").append(firstname).append(' ').append(lastname); sb.append("\nI'm ").append(age).append(" year-old"); sb.append("\nMy phone numbers are:"); for(int i=0; i