Home > Java > javaTutorial > How to enter newline in java

How to enter newline in java

coldplay.xixi
Release: 2020-08-18 11:43:38
Original
12270 people have browsed it

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

How to enter newline in java:

First method: use

System.out.println()
Copy after login

This is a new line.

Second type: Use

System.out.print("\n");
Copy after login

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");
Copy after login

Change two lines

Change three lines:

System.out.println("\n\n"\n);
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template