!7 set flag AllPublic. !include once #1019934 // BCEL import org.apache.bcel.Const; import org.apache.bcel.generic.*; p { ClassGen cg = new("User123", "java.lang.Object", null, Const.ACC_PUBLIC, new S[] { className(IF0) }); cg.addEmptyConstructor(Const.ACC_PUBLIC); // make code for get() method /* new InstructionList il; ConstantPoolGen cp = cg.getConstantPool(); var factory = new InstructionFactory(cg); MethodGen mg = new MethodGen(Constants.ACC_PUBLIC, Type.VOID, new Type[] { new ObjectType("java.awt.event.ActionEvent") }, null, "get", "foo", il, cp); */ byte[] bytes = cg.getJavaClass().getBytes(); var cl = new InMemoryClassLoader(myClassLoader()); Class c = cast cl.defineAClass("User123", bytes); print(c); IF0 f = newInstance(c); print(f); print(value := f!); }