1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
public class G19990310_01 { public static void main (String[] args) { int i = 0; try { System.out.println ("pass 1"); i++; } finally { System.out.println ("pass 2"); i++; } if (i == 2) System.out.println ("OK"); else System.out.println ("NG i = " + i); } }