difference between newLine() and carriage return(“\r”)

后端 未结 5 1911
失恋的感觉
失恋的感觉 2020-12-05 22:44

What is the difference between newLine() and carriage return (\"\\r\")? Which one is best to use?

File f = new File(strFileGenLoc);
BufferedWrit         


        
5条回答
  •  执笔经年
    2020-12-05 23:05

    Write a line separator. The line separator string is defined by the system property line.separator, and is not necessarily a single newline ('\n') character.

    source: http://download.oracle.com/docs/cd/E17476_01/javase/1.5.0/docs/api/java/io/BufferedWriter.html

提交回复
热议问题