As you can see in this example, you can use the interface reference where you don't need to know implementation details, or where you rather not know them. The animals array may have objects of any concrete Animals. Which move() implementation executes in each iteration depends on the actual object referenced. Polymorphism lets you work through abstractions this way. You may ask, why the hell do I need this? I suggest to take a good look at design patterns, where you will find excellent examples of how useful and powerful this technique is.
Biju: Yes, that's the output of the program, but only assuming that the array has 3 elements, in this order: a Snail, a Cheetah and an Eagle. (This wasn't implied in my code.) Whatever concrete Animal objects are in the array, their concrete move() methods will execute. So you see that in order to use polymorphism, you need to make an object oriented design that recognizes the abstractions in the supertype. You can safely say that all your Animals will move in one way or another, so you can define a move() method at the Animal level. Then, implementation details of how specific animals have to move, go directly in the subclasses. Remember, you can have a supertype reference variable that actually points to a subclass object, i.e.: Animal myAnimal = new Snail(); What you can do through that reference is limited by what the supertype interface exposes. But then again it's the subclass implementation that executes: myAnimal.move(); // will display 'crawl' because the actual object is a Snail [ September 23, 2007: Message edited by: greg buela ]