System.lineSeparator () does not exist in android

System.lineSeparator() not available when I am developing Android. I had to use an older version of System.getProperty("line.separator") .

Can someone explain to me why this is? Is this because the Android SDK does not use Java 7?

+6
source share
1 answer

Yes, System.lineSeparator() is a JAVA 1.7 function. System.getProperty("line.separator") is the right way to do this before 1.7

There is an open error on the oracle site where System.lineSeparator() not marked with @Since 1.7. http://bugs.sun.com/view_bug.do?bug_id=7094275

"The new static lineSeparator () method in the java.lang.System class is new in java 1.7, so it should have the @since 1.7 annotation present in javadoc."

+19
source

Source: https://habr.com/ru/post/955158/


All Articles