For a given class or interface how do we find out the list of subclasses or implemented classes ? which is a most convenient way to do this ?
How eclipse quick search (ctrl + T) works to find out the list of subclasses or implemented classes for a given class or interface ?
The Oracle/Sun API documentation has a “known subclasses” link, but that will probably not find all the subclasses. It is not a usual requirement of object-orientation that a superclass “know” anything about its subclasses.
A class shouldn't know about its sub classes. The reason why you can see the "known subclasses" in the Javadoc pages is because the Javadoc tool loads these classes as well. It doesn't find the sub classes based on a class - it finds the sub classes when going through all the classes, and then just matches them with the super class. That's also why it's called known subclasses - these are only the sub classes that were known when running the Javadoc tool. For example, JPanel has only two known sub classes where there are probably hundreds or thousands around. However, these were not available when the Javadoc tool was running for the Java SE source code.
Eclipse probably does it in a similar way. It checks all the classes available in the JRE and other libraries, and sees which ones extend the current class.