The overriding method can throw narrower or fewer exceptions. Just because an overridden method "takes risks" doesn't mean that the overriding subclass' exception takes the same risks. Bottom line: an overriding method doesn't have to declare any exceptions that it will never throw, regardless of what the overridden method declares.
This above quote doesn't fit with below code then what does it mean ?
I thought this should be compile and run without any problem.eat() has been overridden successfully then why compile error ?