// typeinfo/toys/GenericToyTest.java // Testing class Class. package typeinfo.toys; public class GenericToyTest { public static void main(String[] args) throws Exception { Class ftClass = FancyToy.class; // Produces exact type: FancyToy fancyToy = ftClass.newInstance(); Class up = ftClass.getSuperclass(); // This won't compile: // Class up2 = ftClass.getSuperclass(); // Only produces Object: Object obj = up.newInstance(); } } /* Output: (None) */