Java: Making reference null after closing stream
Posted
by Hei
on Stack Overflow
See other posts from Stack Overflow
or by Hei
Published on 2010-03-22T19:50:50Z
Indexed on
2010/03/22
19:51 UTC
Read the original article
Hit count: 144
java
Is it a good practice to set stream references to null after closing them? Would this release resources in any way?
Example:
BufferedReader input= new BufferedReader(new FileReader("myfile.txt"));
// code
input.close(); input = null;
// possible more code
© Stack Overflow or respective owner