Inheritance
Inheritance is the process of creating new classes, called derived class, from existing or base classes. The derived class inherits all the capabilities of the base class but can add embellishments and refinements of its own. The base class is unchanged by this process.
Inheritance permits code reusability. Once a base class is written and debugged, it need not be touched again but can nevertheless be adapted to work in different situations. Reusing existing code saves time and money and increases a program’s reliability. Inheritance can also help in the original conceptualization of a programming problem, and in the overall design of the program. It is also help to add some enhancements to the base class. One result of reusability is the ease of distributing class libraries. A programmer can use a class created by another persons or company, and without modifying it, derived other classes for it that are suited to particular situations.
No comments:
Post a Comment