Question: Consider a try with multiple catch blocks. Inside the try block, you have written a segment of code that may cause one of the following
Consider a try with multiple catch blocks. Inside the try block, you have written a segment of code that may cause one of the following three exceptions to be thrown, depending on the circumstances:
ExceptionLinks to an external site.
IOExceptionLinks to an external site.
FileSystemExceptionLinks to an external site.
Put the catch blocks in the correct order, so that your program can respond differently to each exception and there is no unreachable code.
try
Hidden segment of code
catch
Exception
e catch block
catch
IOException
e catch block
catch
FileSystemException
e catch block
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
