Learn standard output in Java step by step. Understand System.out, print(), println(), syntax, rules, and examples with beginner-friendly explanations and clear code samples.
Before learning print() and println(), itβs important to understand Standard Output.
Standard Output (stdout) is the default place where a program sends its output.
π In simple words:
It is the console screen where Java displays results.
When you run a Java program, anything printed using System.out appears in the terminal/console window.
System.out.printlnLook at this statement:
System.out.println("Hello");
It has three parts:
| Part | Meaning |
|---|---|
System |
Built-in Java class |
out |
Standard output stream |
println |
Method to print and move to next line |
So it means:
βSend the text
Helloto the standard output and go to a new line.β
public class Main {
public static void main(String[] args) {
System.out.println("Welcome to Java");
}
}
Console Output
Welcome to Java
Here:
System.out.println("Line 1");
System.out.println("Line 2");
System.out.println("Line 3");
Output
Line 1
Line 2
Line 3
Each line appears separately because println() moves to the next line.
print() with Standard OutputSystem.out.print("Java ");
System.out.print("Programming");
Output
Java Programming
Here output is sent to the same standard output line.
Java Program β System.out β Console Screen
Understanding it helps beginners learn:
Think of:
The program speaks β microphone carries sound β audience hears it.