// 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) 
public class AC4 {
    public static void main(String[] args) throws InstantiationException, IllegalAccessException {
        IC[] o = new IC[2];
        o[0] = new IC() { public IC clone() { try { return this.getClass().newInstance(); } catch (Exception e) { return null; } } };
        o[1] = o[0].clone();
        System.out.println(o[0].getClass() == o[1].getClass());
    }

}

interface IC extends Cloneable {
    public IC clone();
}
