By: aathishankaran Printer Friendly Format
Polymorphism, Encapsulation and Inheritance Work Together
properly applied, polymorphism, Encapsulation and Inheritance combine to produce
a programming environment that supports the development of far more robust and
scaleable programs than does the process-oriented model.
well-designed hierarchy of classes is the basic for reusing the code in which
you have invested time and effort developing and testing. Encapsulation allows
you to migrate your implementations over time without breaking the code that
depends on the public interface of your classes. Polymorphism allows you to
create clean, sensible, readable and resilient code.
final attribute, polymorphism, is clearly reflected in the ability of car
manufacturers to offer a wide array of options on basically the same vehicle.
example, you can get an antilock braking system or traditional brakes, power or
rack-and-pinion steering, 4,6 or 8 cylinder engines. Either way, you will still
press the break pedal to stop, turn the steering wheel to change direction and
press the accelerator when you want to move. The same interface can be used to
control a number of different implementations.
Most Viewed Articles (in Java )
Latest Articles (in Java)
Comment on this tutorial
- Data Science
- Cloud Computing
- Java Beans
- Mac OS X
- Office 365
- Tech Reviews