fork download
  1.  
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. class ThrowsDemo {
  8. public void method() throws ArithmeticException{
  9. try{
  10. int a=5,b=0,c;
  11. c= a/b;
  12. System.out.println(e);
  13. }
  14.  
  15. }
  16.  
  17. public static void main(String agrs[]){
  18. ThrowsDemo obj= new ThrowsDemo();
  19. obj.method();
  20. }
  21. }
Success #stdin #stdout 0.04s 4386816KB
stdin
Standard input is empty
stdout
java.lang.ArithmeticException: / by zero