Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1.  
  2. public class X {
  3. public static void main(String[] args) {
  4. System.out.println("doit: "+doit());
  5. }
  6.  
  7. public static int doit() {
  8. try {
  9. System.out.println("try");
  10. throw new RuntimeException("exception");
  11. } finally {
  12. System.out.println("finally");
  13. return 1;
  14. }
  15. }
  16. }
  17.  
  18.  
  19. // [frsyuki@xcore ~]$ javac X.java
  20. // [frsyuki@xcore ~]$ java -cp . X
  21. // try
  22. // finally
  23. // doit: 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement