import java.io.*;
class Dynamic {
  int kind;
  Object value;

  Dynamic(int k, Object v) { kind=k; value=v;}

  public static void main(String args[]) throws Exception {
    FileOutputStream out = new FileOutputStream("Hopkins");
    ObjectOutputStream s1 = new ObjectOutputStream(out);
    s1.writeObject("Type Inference"); s1.writeInt(2000);
    s1.flush(); s1.close();

    FileInputStream in = new FileInputStream("Hopkins");
    ObjectInputStream s2 = new ObjectInputStream(in);
    String str = (String)s2.readObject(); in.close();

    p(new Dynamic(1, new Integer(0)));
    p(new Dynamic(2, new Boolean(true)));
  }

  static void p(Dynamic d) {
    switch(d.kind) {
    case 1: Integer i=(Integer)d.value; break;
    case 2: Boolean b=(Boolean)d.value; break;
    }
  }
}