fork download
  1. class Main {
  2. public static void main (String[] args) throws java.lang.Exception {
  3. System.out.println(teste());
  4. }
  5.  
  6. public static boolean teste() throws java.lang.Exception {
  7. try {
  8. System.out.println("Parte 1");
  9. metodo();
  10. return false;
  11. } catch (Exception ex) {
  12. System.out.println("Parte 2");
  13. throw new Exception();
  14. }
  15. }
  16.  
  17. public static void metodo() throws java.lang.Exception {
  18. throw new Exception();
  19. }
  20. }
  21.  
  22. //https://pt.stackoverflow.com/q/98068/101
Runtime error #stdin #stdout #stderr 0.06s 32572KB
stdin
Standard input is empty
stdout
Parte 1
Parte 2
stderr
Exception in thread "main" java.lang.Exception
	at Main.teste(Main.java:13)
	at Main.main(Main.java:3)