Prog3.java

import java.io.*;
import java.lang.reflect.*;
class Prog3 {
  public static void main(String[] args) 
    throws IOException, ClassNotFoundException, NoSuchMethodException, 
           IllegalAccessException, InvocationTargetException {
    ObjectInputStream ois =
      new ObjectInputStream(new FileInputStream("essai"));
    ClassWithStaticAttributes e1 = new ClassWithStaticAttributes(10);
    Class a = new VerboseClassLoader().loadClass("C");
    Class[] tc  = { Class.forName("java.io.ObjectInputStream") };
    Object[] to = { ois };
    Method m = a.getMethod("read",tc);
    Object o = m.invoke(a,to);
    System.out.println(e1.toString());
    System.out.println(o.toString());
    ois.close();
  }
}