Is it possible to create an instance of a derived class in abstract ancestor class using reflection Lets say:
abstract class Base {
public Base createInstan
You can use Class.forName()
and Class.newInstance()
to create any class. But there's no way to easily identify subclasses of a class. See this JavaWorld tip for a technique to do this.
I think , however, the real issue is what is it you're ultimately trying to achieve, and can it be done more easily using conventional techniques.