[Jeanne]: You would have to loop through all classes using reflection
...which in turn raises the question, how do you get all classes? The only way I know is to get the classpath (System.getProperty("java.class.path")), separate it using File.pathSeparator, and then search each part of the classpath for valid class files. (Which may be single .class files, or .class files inside a .jar file.) Even then, at best you can check all classes available in the classpath - but it's always possible to define a new class dynamically with a ClassLoader. So you're never guaranteed of finding all subclasses, but you can find all subclasses which are in the classpath.
I might do this as part of a static analysis tool. Eclipse can display the hierarchy tree up and down given any class. But I can't imagine doing it as a function of a running application. A superclass that needs to know its subclasses sounds suspect.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi