I want to compare contens of my two txt files and write the different words in other file3.txt file
I want to do compare method in this way to write another txt file. A
I think you have to flush() your writer before closing it.
private static void write(ArrayList out, String fname) throws IOException {
FileWriter writer = new FileWriter(new File("D:\\Denemeler\\deneme3.txt"));
for (int i = 0; i < out.size(); i++) {
writer.write(out.get(i) + "\n");
}
// Flush the writer before closing it.
writer.flush();
writer.close();
}