The principle, favor composition over inheritance does not mean never use inheritance.
There is rarely (if ever) a situation where inheriting a concrete implementation is
necessary. And some would argue that it is never a good thing.
It would probably be a good thing in narrow situations, but trying to enforce it across in many situations would be rather pointless. Take the String class, for an example. Use a Comparable reference, you have taken away all the functionality of that class, unless you cast it to a String.
Granted String is a unique case, but since you used it as your example, I was thinking more like if String was an interface that extended the Comparable, and CharSequence interfaces and defined the rest of its method in the String interface, then we could always refer to the String interface and never be coupled to any particular String implmentation.
If your class only has those methods that are required through the implemented interfaces, it isn't a problem, but that is rarely the case.
Obviously thats true for standard library classes, but there is nothing keeping one from defining all the methods in a custom class through an interface.
[ June 03, 2006: Message edited by: Garrett Rowe ]