ClassWithStaticAttributes.java

import java.io.*;
public class ClassWithStaticAttributes implements Serializable {
  private static int a = 0;
  private int b;
  public ClassWithStaticAttributes() {
    ++a;
  }
  public ClassWithStaticAttributes(int val) {
    this();
    b=val;
  }
  public String toString() {
    return "(" + a + "," + b +")";
  }
}