object cannot be resolved in finally block -
why error: rawdata cannot resoled in block?
in:
public void parsedata(string filename) throws ioexception { try { datainputstream rawdata = new datainputstream(new fileinputstream(filename)); /* here i'm gonna something*/ } catch (filenotfoundexception e) { e.printstacktrace(); } { rawdata.close(); } } thank you
you declared rawdata inside try block.
variable not exist outside of it.
in particular, happen if try block exits before line?
you need move declaration outside try.
Comments
Post a Comment