Syntax

Java Print to Console Syntax

In Java, print to console: prints a line to standard output — System.out.println("Hello");

Quick Answer

Syntax
System.out.println("Hello");
JavaSyntax

Print to Console

Code example
System.out.println("Hello");

Prints a line to standard output.

Learn More

How to print to console in Java

  1. Open your Java file or editor.
  2. Copy the example, then replace its sample names and values for your code.

Java Print to Console Syntax

Use System.out.println("Hello");.

Related Syntax References

Frequently asked questions

What is the Java syntax for print to console?

Use this pattern: System.out.println("Hello");

Can I copy this Java code example?

Yes. Use Copy code and adapt the example to your program.

Is this Java syntax different on Mac or Windows?

No. The language syntax is the same across operating systems.

Official source · How we verify