System.out.println in Java

The term “System.out.println is a compiled statement that is one of the most used statements in the history of Java. It is called SOP in short as well. This statement is used to print any type of argument passed into the System.out.

System.out.println("Hello World");

Let us break down the statement into three parts to easily understand the meaning of it:

  • System

A system is a final class that is present in the java.lang package. This class provides various facilities to the users including standard input and output, and error output streams. It also helps the users to access the externally declared properties and the environment variables and the users can easily load files and libraries through this class. The users can copy a portion of an array is a short period of time using the system class.

  • Out

Out is a static variable type print stream present in the system class. The access specifiers of this variable are public and final. This variable gets instantiated at startup and gets mapped with the output console of the host. It opens itself as soon as it gets instantiated and is available to take in data.

  • Println()

The println() is a method present in print stream class. This method is used to print the data passed into the standard console. There are different types of println method that are used in Java for different arguments. When a println method is called, it invokes the print method and adds a newline.

Leave a Reply

Your email address will not be published. Required fields are marked *