fork download
  1. class Main {
  2. private static int test1() {
  3. int res = 0;
  4. try {
  5. return res;
  6. } finally {
  7. res = 1;
  8. }
  9. }
  10.  
  11. private static int test2() {
  12. try {
  13. return 0;
  14. } finally {
  15. return 1;
  16. }
  17. }
  18.  
  19. public static void main (String[] args) {
  20. System.out.printf("test1: %d\n", test1());
  21. System.out.printf("test2: %d\n", test2());
  22. }
  23. }
Success #stdin #stdout 0.05s 2184192KB
stdin
Standard input is empty
stdout
test1: 0
test2: 1