This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am experimenting with using the basic IO classes needed for the SCJP exam. I am trying to read the contents of one file using FileReader and BufferedReader, and then write this to another file using PrintWriter. However, whether I use the println() or the print() method of PrintWriter, I am getting extra characters at the end of each line. They are showing up in notepad++ as square boxes when I use println() and little null graphics when I use print(). I have tried a basic text editor like plain notepad and it's the same story there.
I have googled and think it might have something to do with an extra '\n' character when I use println. If this is the case though I would have thought that there would simply be an extra space between all the lines. Also, when I use the print method, there are no line breaks at all in the target file.