Java Java Basics Perfecting the Prototype Reviewing Our Feedback

Ronny Ahero
Ronny Ahero
3,561 Points

Newline command '\n'

Hi, just a quick question on the newline command '\n'. In this video, why did he use '\n' instead of '%n'?

2 Answers

Simon Coates
Simon Coates
3,092 Points

I had only ever seen "\n". However, I did a little google search and stackoverflow has an article discussing this. They seem to think %n is more portable as the new line code differs by platform, though someone suggested caution with %n in a networking context.