What is the meaning of System.out.println in Java?
System.out.println is a Java statement that prints the argument passed, into the System.out which is generally stdout.
- System is the Class
- out is a static member of the class
- println() is a method of PrintStream class
It is a class in the java.lang package . The out is a static instance of the System class, and is an instance of java.io.PrintStream . The println() is a method of java.io.PrintStream.
It is a static object of PrintStream class(class reference variable) i.e, static PrintStream out;
and PrintStream is a predefined class in java.io package.
since its static that is why we are can call out object using class name
println() is the method in PrintStream class for Standard output stream. So to access println method , we need PrintStream object which we are getting through System.out. so, finally
its System.out.println to produce standard output Stream. This method is overloaded to print message to output destination, which is typically a console or file.
Public static void main(String args)
System.out.println(“ HELLO WORLD ”);
Output will be – HELLO WORLD