Function f() always throws an exception. But at "Runtime". The compiler has no way to figure that out at compile-time. So, for the compiler if t.f() does not throw an exception, then the catch clause is never executed. So, e1 is never initialized. However finally always is. Hence the problem.