Difference between System.getProperty(“line.separator”); and “\n”?

System.getProperty("line.separator") returns the OS dependent line separator.

On Windows it returns "\r\n", on Unix "\n". So if you want to generate a file with line endings for the current operating systems use System.getProperty("line.separator") or write using a PrintWriter.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)