“Java Multiple Catch Blocks” Respostas de código

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());
    } 
  }
}
SAMER SAEID

Bloco Java multi-capacho

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());
    }
  }
}
SAMER SAEID

Respostas semelhantes a “Java Multiple Catch Blocks”

Perguntas semelhantes a “Java Multiple Catch Blocks”

Procure respostas de código populares por idioma

Procurar outros idiomas de código