This code is from Dan Chisholm mock exam. I have changed the original question and compiled this. It is giving the following error message. Please explain this error.
The exception is a result of the fact that e1 is the parent class of e3. The first catch statement (e1) will catch all e3 exceptions thrown. The compiler is smart enough to know that any e3 exception thrown will never make it outside of the e1 block.
Try switching the order of the catch blocks and it should compile -- i.e. catch e3 and then later catch e1.