Consider a try block with multiple catch blocks. Inside the…
Consider a try block 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: IOException SocketTimeoutException ConnectException Put the catch blocks in the correct order in the try block, so that your program can respond differently to each exception. The class hierarchy (parent->child relationship) of these exceptions are as listed in the above order. Please refer to the provided JavaDoc links, for further details.