For some reason this code results in a truncated text.txt file. It should (according to me) write out 1000 results, but the output file has various amounts of lines (dependi
Once you open io (Reader, Writter or BufferR/W, ...), you have to close it later to close that stream and release the resource. Incase your code has nested stream (File, FileReader, BufferedReader) or (Writer1, Writer2), you have to close it separately order right after(BufferedReader, FileReader, File) or (Writer1.close() before using Writer2)