The answers of the quiz:
It compiles successfully because the checked exception FoodException is caught. No problems at runtime.
At compile time the reference a is an Animal. And the exception FoodException is not caught or declared to be thrown. So compile error.
Similar to case 1: no compile or runtime errors
The reference is cast to Animal and the method Animal.eat throws FoodException which is not caught or declared to be thrown, so compile error.
The reference is cast to Tiger and the method Tiger.eat throws VeggieException which is a subclass of Exception thrown by method5, so the source compiles. But at runtime it will throw a ClassCastException because the object the reference a is pointing to is not a Tiger object.
The reference a is cast to Elephant and the method Elephant.eat throws no exception. It will compile and run successfully. A method is free to declare to throw an exception without actually throwing it.
This time it fails to compile because the catch block is unreachable.