DEV Community

LAKSHMI G
LAKSHMI G

Posted on

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

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:

In this print method has inside printStream class this class it takes an OutputStream as arugment in its constructor
PrintStream(OutputStream out)this OutputStream is abstract class.

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

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

Top comments (0)