fork download
  1.  
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. class Demo
  8. {
  9. public static void main(String args[])
  10. {
  11. int num1=1,num2=0,result=0;
  12. try
  13. {
  14.  
  15. result = num1/num2;
  16. System.out.println("The result is:" + result);
  17. }
  18. {
  19. System.out.println("Error...Division by Zero");
  20. }
  21. {
  22. System.out.println("Error...Out of Bounds");
  23. }
  24. {
  25. System.out.println("Not able to convert the values from string to integer");
  26. }
  27. catch(Exception e)
  28. {
  29. System.out.println("General Exception");
  30. }
  31. }
  32. }
Success #stdin #stdout 0.04s 4386816KB
stdin
Standard input is empty
stdout
Error...Division by Zero