What's System.out.println in Java?
System.out.println is a statement that prints the argument passed, into the System.out which is generally stdout.
- System is a Class
- out is a Variable
- println() is a method
System is a class in the java.lang package . The out is a static member of the System class, and is an instance of java.io.PrintStream . The println is a method of java.io.PrintStream. This method is overloaded to print message to output destination, which is typically a console or file.
the System class belongs to java.lang package
public static final PrintStream out;
//...
}
the Prinstream class belongs to java.io package
public void println();
//...
}