why does it happen?
807600Sep 9 2007 — edited Sep 9 2007i have two cases to analise tell me why so happens
void method()
{
Integer i ;
try{ i = new Integer(8);
}catch(Exception e){;}
System.out.println(i);
}
// generates an error that object might not be initialised now as far as i know i is object whose reference is outside try block than why does it get lost.
Interger i;
void method()
{
i = new integer(9);
}
void anotherMethod()
{
System.out.print(i);
}
// in the above case no such problem occurs