CR+LF

The history of CR+LF

A teleprinter, photo by Ries Bosch
  • CR stands for carriage return – character that returns the print head to column 0
  • LF stands for linefeed – character that advances the paper one line

\r (carriage return) and \n (new line) characters for modern computers

Differences in characters

There’s an entire wikipedia page on this

Unix uses \n and Windows uses \r\n (for most applications, not all)

Not a problem for autograder because your code will be compiled and run on a Unix VM

A problem that you will encounter many times for other reasons

JUnit tests fail because the text file that your output is compared against uses only \n