fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Test
  9. { int count = 0;
  10.  
  11. void A() throws Exception
  12. {
  13. try
  14. {
  15. count++;
  16.  
  17. try
  18. {
  19. count++;
  20.  
  21. try
  22. {
  23. count++;
  24. throw new Exception();
  25.  
  26. }
  27.  
  28. catch(Exception ex)
  29. {
  30. count++;
  31. throw new Exception();
  32. }
  33. }
  34.  
  35. catch(Exception ex)
  36. {
  37. count++;
  38. }
  39. }
  40.  
  41. catch(Exception ex)
  42. {
  43. count++;
  44. }
  45.  
  46. }
  47.  
  48. void display()
  49. {
  50. System.out.println(count);
  51. }
  52.  
  53. public static void main(String[] args) throws Exception
  54. {
  55. Test obj = new Test();
  56. obj.A();
  57. obj.display();
  58. }
  59. }
Success #stdin #stdout 0.05s 4386816KB
stdin
Standard input is empty
stdout
5