interface InterA { void print(); } class ClassA { Object o; ClassA(T t){ o = t; } } class Samp09 { public static void main(String[] args){ InterA ia = new InterA(){ public void print(){ System.out.println("Hello!"); } }; ClassA ca = new ClassA(ia); ((InterA)ca.o).print(); } }