this is one of the interview question. I am supposed to print multiple lines of output on command line, without using the newline(\\n) character in java. I trie
\\n
One way is this: Platform Independent
final String EOL = System.getProperty("line.separator"); System.out.println('1' + EOL + '2' + EOL + '3' + EOL + '4' + EOL + '5');
This is Platform Dependent
char eol = (char) 13; System.out.println("" + '1' + eol + '2' + eol + '3' + eol + '4');