Java System lineSeparator() Method

The lineSeparator() method of Java System class returns line separator string which is system dependent. It returns same value every time.

Syntax

Returns

  • It returns "\n" on UNIX System.
  • It returns "\r\n" on Windows System.

Example

Output:

13
10

Example 2

Output:

Shubham
Jadon