System.lineSeparator()
is not available when I am doing my Android development. I had to use the older version System.getProperty("line.separator")
instead.
Can anyone explain to me why is that? Is it because the Android SDK is not using Java 7?
Yes, System.lineSeparator()
this is a JAVA 1.7 feature.
System.getProperty("line.separator")
is the correct way to do it pre 1.7
There is an open bug on the oracle site where System.lineSeparator()
has not been marked with @Since 1.7.
http://bugs.sun.com/view_bug.do?bug_id=7094275
"The new static method lineSeparator() on java.lang.System class is new in java 1.7, so should have the @since 1.7 annotation present in the javadoc."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With