This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Polymorphism: Definition of Richard G. Baldwin (His Introductory Java Programming Tutorial will get you started): compile-time polymorphism: method overloading runtime polymorphism: method overriding and inheritance
I thought polymorphism was only seen at runtime. You will find lots of examples. Imagine you have a superclass, and you have subclasses; they can have methods which have the same signature (overridden) which use different operations. Example:-At compile time all the compiler will notice is that each of these three concrete classes extends Shape, and has a getArea() method. Also that the return types are compatible (in this case all the same, double). Now, at runtime, you can create different subclasses of Shape:Your compiler can't tell whether you will enter 1 for Circle or 2 for Square or 3 for Triangle. But each has a getArea() method which the JVM finds and uses at Runtime.