fork download
  1. class MultipleCatchBlock4
  2. {
  3. public static void main(String[] args)
  4. {
  5. try
  6. {
  7. String s=null;
  8. System.out.println(s.length());
  9. }
  10. {
  11. System.out.println("Arithmetic Exception occurs");
  12. }
  13. {
  14. System.out.println("ArrayIndexOutOfBounds Exception occurs");
  15. }
  16. catch(Exception e)
  17. {
  18. System.out.println("Parent Exception occurs");
  19. }
  20. System.out.println("rest of the code");
  21. }
  22. }
Success #stdin #stdout 0.08s 43024KB
stdin
Standard input is empty
stdout
Parent Exception occurs
rest of the code