hello all,
I have a question regarding Files and Streams. What happens if you dont close the stream that you are using with the close().. ??!
I know that the OS allows a limited number of files to be opened at a time depending on your RAM and all of that stuff, but I mean on the short term,, what are the consequences ???
I read that the file gets locked and you cant open it or delete it.. but I dont see any of that happens ??!
Thanks for the help.
import java.io.*;
public class example {
public static void main (String args[]) {
FileOutputStream out = new FileOutputStream("example.txt");
out.write('H');
out.write('E');
out.write('L');
out.write('L');
out.write('O');
// out.close() ... what happens if we dont call this method ??
}
}