Neha,
If i comment out the method eat in Mammal then will i get compile time error.
When an expression like c.eat(h) is compiled,
java compiler
will search for all methods eat(h) that have the same
parameter type as h (i.e. Mammal) in class "c" (i.e Cattle)
and inherited methods in "c"'s superclass (i.e Mammal).
Since the only method eat() that has the right parameter type
was in Mammal which you have removed, compiler complained for
not being able to find an applicable method.
You can check JLS 15.12.1 & 2 for details.
[This message has been edited by Nain Hwu (edited November 12, 2001).]