System.out.println()
Writes the value and moves to the next line.
Syntax
System.out.println(value)
Description
The main way of output in Java. There is also print (does not add a newline) and printf (formatted).
Example
Loading editor…
Expected output
Hello World
When to use?
Showing results, debugging.
Common mistakes
- ⚠️ Every statement ends with a semicolon (;).