Java - built-in Java statement
System.out.println
is a built-in Java statement used to print text or values to the console (also called the standard output). It’s one of the most commonly used statements for debugging or displaying messages.
Breakdown of the Statement:
-
System
– A built-in class in thejava.lang
package that provides access to system-level resources. -
out
– A static member of theSystem
class. It is an object ofPrintStream
that represents the standard output stream. -
println()
– A method of thePrintStream
class that prints the content followed by a new line.
Example
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
Output:
Hello, World!