✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
package exceptions;
import java.io.IOException;public class ExceptionHandling { public static void main(String[] args) { try { testException(-5); testException(-10); } catch(IOException e) { System.out.print(e.getMessage()); } finally { System.out.print("Releasing resources "); } } public static void testException(int n) throws IOException { if (n < 0) { throw new IOException("Negative Integer " + n + "FAIL"); } else if (n > 10) { throw new IOException("Only supported for index 0 to 10 "); } }}