Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Java Exception handling using Java throw

class Main {
  public static void divideByZero() {

    // throw an exception
    throw new ArithmeticException("Trying to divide by 0");
  }

  public static void main(String[] args) {
    divideByZero();
  }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Java #Exception #handling #Java #throw
ADD COMMENT
Topic
Name
1+6 =