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

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

public class Listing4103
{
  public static void main(String[] args)
  {
    try {
      FileOutputStream fs = new FileOutputStream("test2.ser");
      ObjectOutputStream os = new ObjectOutputStream(fs);
      os.writeInt(123);
      os.writeObject("Hallo");
      os.writeObject(new Time(10, 30));
      os.writeObject(new Time(11, 25));
      os.close();
    } catch (IOException e) {
      System.err.println(e.toString());
    }
  }
}