The difference between print\println (Recommended learning: java course)
print will use its parameters Displays in the command window and positions the output cursor after the last character displayed.
println displays its parameters in the command window, adds a newline character at the end, and positions the output cursor at the beginning of the next line.
For example:
package other; public class TestPrint { public static voidmain(String[] args) { int i = 4; double j = 5; System.out.print("用print输出i:"+ i); System.out.println( "用println输出i:"+ i); System.out.print("i的值为"+i+",j的值为"+j); } }
Run result:
用print输出i:4用println输出i:4 i的值为4,j的值为5.000000
The above is the detailed content of The difference between print and println in java. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 English version
Recommended: Win version, supports code prompts!

WebStorm Mac version
Useful JavaScript development tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Zend Studio 13.0.1
Powerful PHP integrated development environment