我认为是和本文编辑软件有关。
你用UltraEdit打开就不会有这样的现象。
还有我一般输出都是换行符都是在封装一下:
PrintWriter pw = new PrintWriter(out12);
然后用pw.println()和print方便了很多。因为不同的系统下,换行符是不一样的,windows下是"\r\n",其他的事'\n',而用PrintWriter.println()它会自动判断的。
JDK API如是说:
public void println()
Terminate the current line by writing the line separator string. The line separator string is defined by the system property line.separator, and is not necessarily a single newline character ('\n').