“Java Tente ... Catch Block” Respostas de código

Java Tente ... Catch Block

try {
  // code
}
catch(Exception e) {
  // code
}
SAMER SAEID

Java Tente ... Catch Block

class Main {
  public static void main(String[] args) {

    try {
      int divideByZero = 5 / 0;
      System.out.println("Rest of code in try block");
    }

    catch (ArithmeticException e) {
      System.out.println("ArithmeticException => " + e.getMessage());
    }
  }
}
SAMER SAEID

Respostas semelhantes a “Java Tente ... Catch Block”

Perguntas semelhantes a “Java Tente ... Catch Block”

Procure respostas de código populares por idioma

Procurar outros idiomas de código