The Component class

Advertisement
Can anybody tell me why the Component class should be an abstract class? It seems to me that the class should be defined as a concrete class because non of its methods is abstract type. Thanks. altech
Advertisement

Replay

Most likely it was done so that developers seeking to create a new flavor of AWT Component would be required to extend the Component class, rather than creating generic Components left and right. A generic Component object isn't really useful at all anyway, due to its lack of interesting behavior.
The class is intended to act as an interface for users of Component subclasses (not interface as in a Java interface, but in the general OO sense of the word). It is a common root for all AWT "components," so that they may be acted upon in a similar fashion utilizing polymorphism.
There may be a more legitimate reason why it is abstract, but this is my guess. It makes sense to me.