Home >Java >javaTutorial >How to enter newline in java
How to enter a newline in java: 1. To change one line, use [System.out.println()]; 2. To change two lines, use [System.out.println("\n\n")] ;3. Change three lines and use [System.out.println("\n\n"\n)].
How to enter newline in java:
First method: use
System.out.println()
This is a new line.
Second type: Use
System.out.print("\n");
This is also a line change.
The first type is similar to the second type. Just, if you want to change two lines, three lines, or multiple lines.
Just use:
System.out.println("\n\n");
Change two lines
Change three lines:
System.out.println("\n\n"\n);
Related learning recommendations:java Basic tutorial
The above is the detailed content of How to enter newline in java. For more information, please follow other related articles on the PHP Chinese website!