Here's a question and answer that I found while surfing the Java NewsGroups a short time ago…   I thought it was a particularly good exchange.  Here's the original question:

"I understand the need for Polymorphism in OOP; but, I was wondering how it applies to real life?  I have seen the Shapes example in different JAVA and C++ books; but, does anyone have a real-life example of their program using polymorphism?

Thanks.

KL"

And, here's the excellent response that was posted a few hours later:

"Certainly!  Here's a simple example, with names changed for confidentiality reasons:

I needed to do some calculations about some transactions. 

First of all, I defined a general Transaction interface, which all transactions implement, and that was used by other parts of the program to manipulate them. 

Next, I had to deal with two very similar transaction types, ReadA and ReadB. Almost all their implementation was identical, but a couple of methods needed to do different things.  I defined an abstract class Read, implementing Transaction, but leaving the two varying methods abstract.  ReadA and ReadB both extend Read, and have their own implementations -- only for the methods that need to be different.

PC"

File:  RealPolymorphism.rtf