Implementing abstract methods at runtime?
问题 Let's say I have an abstract class: abstract class Foo extends Bar { public abstract int foo(); } that I want to extend at runtime to create a Class object. The hope would be that I could have a dynamically generated class: class FooImpl extends Foo { @Override public int foo() { return 5; } } that would be represented by a Class object and that I could then use reflection to create new instances of. The key is that I would like to decide the return value of the method foo() at runtime. My