<p>In C# there is the static property <a href="http://msdn.microsoft.com/en-us/library/system.environment.newline.aspx" rel="noreferrer">Environment.Newline</a> that changed depending on the running platform.</p>

<p>Is there anything similar in Java?</p>

As of Java 7 (and Android API level 19):
```
```
System.lineSeparator()
```
```
Documentation:
Java Platform SE 7
For older versions of Java, use:
```
```
System.getProperty("line.separator");
```
```
See
https://java.sun.com/docs/books/tutorial/essential/environment/sysprop.html
for other properties.