| <<< Byte streams | Index | class SavePerson >>> |
Only object that implements Serializable interface can be saved and restored by the serialization facilities.
Serializable interface defines no operations.
Why? Because the Serializable interface only indicates that a class may be serialized.
import java.util.*;
import java.io.*;
class Person implements Serializable{
private String name;
public Person() {
}
public Person( String n ){
System.out.println("In Person ctr");
name = n;
}
String getName() {
return name;
}
}
| <<< Byte streams | Index | class SavePerson >>> |