Prog1.java

import java.io.*;
class Prog1 {
  public static void main(String[] args) throws IOException {
    ClassWithStaticAttributes e1 = new ClassWithStaticAttributes(10);
    ClassWithStaticAttributes e2 = new ClassWithStaticAttributes(20);
    System.out.println(e1);
    System.out.println(e2);
    ObjectOutputStream oos =
      new ObjectOutputStream(new FileOutputStream("essai"));
    oos.writeObject(e2);
    oos.close();
  }
}