What do you want to save?
Add Code snippet
New code examples
-
Java 2021-11-14 13:22:10
throwing exceptions java
/* In this program we are checking the Student age * if the student age<12 and weight <40 then our program * should return that the student is not eligible for registration. */ public class ThrowExample { static void checkEligibilty(int stuag... Add solution -
Java 2021-10-06 19:17:03
is try and catch block catching only one exception
class Main { public static void main(String[] args) { try { int array[] = new int[10]; array[10] = 30 / 0; } catch (ArithmeticException e) { System.out.println(e.getMessage()); } catch (ArrayIndexOutOfBoundsException e) { ... Add solution -
Java 2021-09-21 10:26:02
java return exception
/* In this program we are checking the Student age * if the student age<12 and weight <40 then our program * should return that the student is not eligible for registration. */ public class ThrowExample { static void checkEligibilty(int stuag... Add solution -
Other 2021-09-13 05:30:02
Can we catch more than one exception in single catch block
From Java 7, we can catch more than one exception with single catch block. This type of handling reduces the code duplication. When we catch more than one exception in single catch block , catch parameter is implicity final. We cannot assign any value ... Add solution