search
HomeJavaJavaBaseWhat is the java print output statement?

The print output statements include: print "System.out.println();" with line breaks, print "System.out.print();" without line breaks, and print bytes "System.out.write();" ”, output according to the format “System.out.printf();”.

What is the java print output statement?

There are four types of output statements in Java:

System.out.println(1111);//换行打印
System.out.print(1111);//不换行打印
System.out.write(2222);//字节输出
System.out.printf("%+8.3f\n", 3.14);//按格式输出

System.out.println(); Yes The most commonly used output statement, it will convert the content in parentheses into a string and output it to the output window (console), and wrap the line. When the output is a basic data type, it will be automatically converted into a string. If the output is An object will automatically call the object's toString(); method and output the return value to the console.

System.out.print(); is very similar to the first one. The difference is that there will be a new line after the previous output. , and this command does not wrap after output.

System.out.printf(); This method continues the output method of C language and outputs through formatted text and parameter list.

Recommended tutorial: "java tutorial"

The above is the detailed content of What is the java print output statement?. For more information, please follow other related articles on the PHP Chinese website!

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment