Hi Lavanya,
First of all you are invoking "eat" methods without "()" but I think thats a typo error.
a.eat();
d.eat();
It is absolutely "OK" to decalre an overridding method in subclass that doesn't throw an exception.
But in this program you are invoking the "eat" method using "Animal" class object. Due to
polymorphism at runtime Dog class "eat" will get executed but since compiler doesn't know that and thinks that "animal" class eat method may throw an exception, it expects that you must enclose it in try-ctach block.
That's the only problem.
Asha