Possible Duplicate:
At runtime, find all classes in a Java application that extend a base class
I need to get list of all the classes (child) which extends a particular class (parent) and then create an instance of them all.
how should I do this in Java?
I would use http://code.google.com/p/reflections/
This can be used in an indexed or cached mode. As @Jagger suggests, a brute force search of every class is relatively slow. You can also limit the search by package e.g.
com.mycom.*