// Project: Serialization // Module: serialization1 // Source code file: TestIn.java // Show how to deserialize a single object. import java.io.*; public class TestIn { public static void main(String[] args) throws IOException, ClassNotFoundException { // Declare inStream object. ObjectInputStream inStream = new ObjectInputStream( new FileInputStream("person.ser")); // Deserialize Person object. Person p = (Person) inStream.readObject( ); // Print Person object. System.out.println(p); // Close inStream object. inStream.close( ); } }