\n is add a new line.
Please note java has method
System.out.println("Write text here");
Notice the difference:
Code:
System.out.println("Text 1");
System.out.println("Text 2");
Output:
Text 1
Text 2
Code:
System.out.print("Text 1");
System.out.print("Text 2");
Output:
Text 1Text 2