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. }
  14. }
  15.  
  16. public static void metodo() throws java.lang.Exception {
  17. throw new Exception();
  18. }
  19. }
  20.  
  21. ////https://pt.stackoverflow.com/q/98068/101
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:14: error: missing return statement
	}
	^
1 error
stdout
Standard output is empty