summaryrefslogtreecommitdiffstats
path: root/Master/Reference Architectures and Patterns/hjp5/examples/Listing4104.java
blob: da24a455cb72723f6c827a853ab7f21aa7d16a45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* Listing4104.java */

import java.io.*;
import java.util.*;

public class Listing4104
{
  public static void main(String[] args)
  {
    try {
      FileInputStream fs = new FileInputStream("test1.ser");
      ObjectInputStream is = new ObjectInputStream(fs);
      Time time = (Time)is.readObject();
      System.out.println(time.toString());
      is.close();
    } catch (ClassNotFoundException e) {
      System.err.println(e.toString());
    } catch (IOException e) {
      System.err.println(e.toString());
    }
  }
}