// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.io.*;

public class DeserNew3 {
    public static void main(String[] args) throws Exception {
        ObjectInputStream ois = new ObjectInputStream(new FileInputStream("../x.ser"));
        X o = (X)ois.readObject();
        System.out.println(o.getF());
        ois.close();
    }
}

class X implements Serializable {
    private static final long serialVersionUID = 1;
    private int f;
    public int getF() {
        return f;
    }
    public void setF(int f) {
        this.f = f;
    }
    public int getF2() {
        return f*f;
    }
}
