Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Java Multiple catch blocks

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) {
      System.out.println(e.getMessage());
    } 
  }
}
Comment

Java Multi-catch block

class Main {
  public static void main(String[] args) {
    try {
      int array[] = new int[10];
      array[10] = 30 / 0;
    } catch (ArithmeticException | ArrayIndexOutOfBoundsException e) {
      System.out.println(e.getMessage());
    }
  }
}
Comment

PREVIOUS NEXT
Code Example
Java :: java 8 validate based on pair of strings 
Java :: sethomebutton listener android 
Java :: Java Arraylist bestimmtes element ausgeben 
Java :: how to array list with a delimiter into text file java 
Java :: ternärer operator java 
Java :: how to refresh activity intent in android 
Java :: Small Change 
Java :: Pattern using recursion in Java 
Java :: venatana emergente con texto java 
Java :: java object array initialization 
Java :: change FS to hdfs java 
Java :: Armstrong Numbers Between Two Integers 
Java :: MinimumAndMaximum 
Java :: check is element present in queue java 
Java :: fibonacci series 
Java :: kakao tech tcp close_wati 
Java :: how to validate information against the database in java 
Java :: final variables in java 
Java :: hashtable 
Java :: gson parse json 
Java :: java join list 
Java :: java program to print vowels in a string 
Java :: searchview android example recyclerview 
Java :: loop through array in java 
Java :: postfix operator in java 
Java :: reverse an android application 
Java :: in java write a code that suppose the following input is supplied to the program: 9 Then, the output should be: 12096 (99+999+9999+999) 
Sql :: postgres get running query 
Sql :: how to get yesterday date in sql 
Sql :: pl sql output 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =