I was just perusing through questions, and I found System.getProperty(line.separator)
used in place of \n
with the author's comment that the code was "portable". Reading through various forums, I've seen two groups:
- People who say there's a difference between Linux's and Windows' interpretation of newline characters, and this compensates for that (with no clear evidence).
- People who say there's no difference by showing code and output examples, which obviously only applies to that code example and not universally.
My feeling is: it's probably non-standard OS's, like for example your company's industrial scanner's OS for example, where you'll notice a difference. When am I going to see a difference between \n
and line.separator
? Can you show an example, please? How did you go about discovering where the variation occurs?