import java.io.*;
public class PersonSerializable implements Serializable {
private String name;
private String occupation;
private char sex;
private int age;
public void setDetails(String name,int age,char sex,String occupation) {
this.name = name;
this.age = age;
this.occupation = occupation;
this.sex = sex;
}
public void displayDetails(){
System.out.println("Name = "+name);
System.out.println("Age = "+age);
System.out.println("Sex= "+sex);
System.out.println("Occupation= "+occupation);
}
}
|