This is the code that I\'ve written.
int num; try { num=100; DoSomething(); System.out.println(num); } catch(Exception e) { DoSomething1(); }
The problem is that num is not initializated, int num = -1; And the error will go away ;)