Advertisement
NLinker

Java quiz

Nov 16th, 2017
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. public class Main {
  2.     public static String foo() {
  3.         try {
  4.             throw new RuntimeException("Oops");
  5.         } finally {
  6.             return "foo";
  7.         }
  8.     }
  9.     public static String bar() {
  10.         try {
  11.             return "bar";
  12.         } finally {
  13.             throw new RuntimeException("Oops");
  14.         }
  15.     }
  16.     public static void main(String[] args) {
  17.         System.out.println(foo());
  18.         System.out.println(bar());
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement