ArithmeticException
KW.java
Output
kodingwindow@kw:~$ javac KW.java
kodingwindow@kw:~$ java KWException in thread "main" java.lang.ArithmeticException: / by zero at KW.main(KW.java:6) kodingwindow@kw:~$
Java program to handle the ArithmeticException
KW.java
Output
kodingwindow@kw:~$ javac KW.java
kodingwindow@kw:~$ java KW Can't divide by zero kodingwindow@kw:~$
What Next?
Java program to handle the NullPointerException
Java program to handle the StringIndexOutOfBoundsException
Java program to handle the ArrayIndexOutOfBoundsException
Advertisement