Saturday, August 8, 2009

INHERITANCE

One of the main goals of object oriated programming is providing reusable code .When you develop a new project,Particularity if the project is large,its nice to be able to reuse proven code rather than to reinventit.Employing old code saves time and,because it has already been used and tested can help supres the introduction of bugs in to a program.Inheritance is the process of creating new classes called derived classes from existing or base classes the derived calss inherits all the capabilities of the base class but can add embellishments and refinements of its own
One advantace of inheritance is reusability
The mechanism of deriving a new class from more than one level.A derived class with only one base class is called single inheritance and on with several base classes is called multiple inheritance on the other hand,the stairs of one class or from more than one class. This process is Hnown as herirachial inheritance.

No comments:

Post a Comment