How do I get a platform-dependent new line character?

How do I get a platform-dependent newline in Java? I can’t use "\n" everywhere.

9 s
9

Java 7 now has a System.lineSeparator() method.

Leave a Comment