Yurttas/PL/OOL/Java/F/06/03/01/DataA.java

 1/**
 2 *  Copyright(C) 1998
 3 *  All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
 4 *
 5 *  Permission to use, copy, modify, and distribute this
 6 *  software and its documentation for EDUCATIONAL purposes
 7 *  and without fee is hereby granted provided that this
 8 *  copyright notice appears in all copies.
 9 *
10 *  @date   : January 1, 1998.
11 *  @authorĀ : Salih Yurttas.
12 */
13
14
15import java.io.*;
16
17public class DataA implements Serializable {
18
19  int a;
20  String b;
21  int c;
22  char d;
23
24  public DataA() {
25    a = 1024;
26    b = "tiger";
27    c = -9;
28    d = 'P';
29  }
30
31  private void writeObject(ObjectOutputStream oOS)
32    throws IOException
33  {
34    oOS.writeInt(a);
35    oOS.writeUTF(b);
36  }
37
38  private void readObject(ObjectInputStream oIS) 
39    throws IOException, ClassNotFoundException
40  {
41    a = oIS.readInt();
42    b = oIS.readUTF();
43  }
44
45}