본문 바로가기

나 어제 배웠다/JAVA[Tip]

Exception in finally Test

import java.lang.System;
import java.lang.Exception;

class FinallyTest{
 public static void main(String[] arg){
  String sTmp = "start";
  String sTmp1 = "end";
  try{
   System.out.println("main try");
   throw new Exception();
  }catch(Exception e){
   System.out.println("main catch");
  }finally{
   if(sTmp.equals("start"))try{throw new Exception();}catch(Exception e){System.out.println("main finally start catch");}   
   if(sTmp1.equals("end"))try{throw new Exception();}catch(Exception e){System.out.println("main finally end catch");}   
  }   
 }
}

'나 어제 배웠다 > JAVA[Tip]' 카테고리의 다른 글

StringTokenizer  (0) 2015.06.04
Object Array 방법  (0) 2010.12.07
iBatis IN 구문 구현 방법  (0) 2010.12.07
예외 처리(Exception)  (0) 2010.11.26
Iterator Design Pattern Sample  (0) 2010.08.03