how to edit my compare method

前端 未结 5 1541
孤城傲影
孤城傲影 2021-01-27 09:27

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

5条回答
  •  隐瞒了意图╮
    2021-01-27 09:59

    You are opening the third file deneme3.txt twice without closing it in between. I guess the second time (in write()) an exception will be thrown, so there will be no write. Remove the first occurence of FileWriter writer = new FileWriter(new File("D:\\Denemeler\\deneme3.txt")); (the one in compare()) and you should be fine.

提交回复
热议问题