Describe an abstract class.- An abstract class is a class that cannot be instantiated but must be inherited. It can contain both implemented methods and abstract methods. - They are closely related to interfaces. - They cannot be instantiated, and are frequently either partially implemented, or not at all implemented. - The main difference between abstract classes and interfaces is that a class may be implemented by an unlimited number of interfaces, but they can be inherited from only one abstract (or any other kind of) class. - A class that is derived from an abstract class may still implement interfaces. - These classes are very useful while creating the components as they allow you specify an invariant level of functionality in some methods, but leave the implementation of other methods until a specific implementation of that class is needed. - They also version well, because if additional functionality is needed in derived classes, it can be added to the base class without breaking code.
|