What is System.out.println() in Java?

Published: (December 11, 2025 at 02:42 AM EST)
1 min read
Source: Dev.to

Source: Dev.to

Understanding System.out.println()

When beginners see System.out.println(), it looks long and confusing. But every part of it has a purpose. This line is not magic — it is simply Java’s way of connecting your program to the standard output system.

println() is a method

println() is a method of the PrintStream class.

PrintStream and OutputStream

PrintStream takes an OutputStream as an argument in its constructor:

PrintStream(OutputStream out)

OutputStream is an abstract class; you cannot create an object directly from it (new OutputStream()).

System class

The System class provides a PrintStream object named out. It is declared as static, so we access it using the class name (System.out).

Back to Blog

Related posts

Read more »