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

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

public class Listing4102
{
  public static void main(String[] args)
  {
    try {
      FileOutputStream fs = new FileOutputStream("test1.ser");
      ObjectOutputStream os = new ObjectOutputStream(fs);
      Time time = new Time(10,20);
      os.writeObject(time);
      os.close();
    } catch (IOException e) {
      System.err.println(e.toString());
    }
  }
}