Java Exception stack trace

Description

Java Exception stack trace


public class Main {
  static void g() {
    int r = 2 / 0;
  }//from   w w w.ja v  a 2  s  .c  o  m

  static void f() {
    g();
  }

  public static void main(String args[]) {
    f();
  }
}

Here is the stack trace for the exception


Exception in thread "main" java.lang.ArithmeticException: / by zero
  at Main.g(Main.java:3)
  at Main.f(Main.java:7)
  at Main.main(Main.java:11)



PreviousNext

Related