I have some code with this structure:
public void method() { Object o; try { o = new Object(); } catch (Exception e) { //Processi
You need to initialize local variables before they are used as below
public void method() { Object o=null; try { o = new Object(); } catch (Exception e) { handleError(); } doSomething(o); }
You will not get the compilation failure until you use local variable which was not initialized