Why does the compiler not understand that a variable is initializing in a block tryor catch complaining about a block finally?
try
catch
finally
int i; try { i = 0; } catch (Exception e) { i = 2; } finally { System.out(i); }
"i" catch , , , , "i" try, "i" , , , , .. "i" , , , "i" catch, "i"
, try, catch. , , . (, , ) , . :
int i; try { System.out.println(i); //i = 0; } catch (Exception e) { System.out.println(i); //i = 2; } finally { System.out.println(i); }
(i = 0;) , finally, - , .
i = 0;
, i . - , finally .
i