// 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 ClassLoadFun {
    public static void main(String[] args) throws Exception {
        Class<I> a = (Class<I>)Class.forName("A");
        Class<I> b = (Class<I>)Class.forName("B"); // no exception
        I oa = (I)a.newInstance();
        I ob = (I)b.newInstance(); // exception
    }
}

interface I { }

class A implements I { }

class B { };
