What is the s.o.p?
System.out.println(); is used to print output to the console, typically for displaying text or variable values, followed by moving the cursor to a new line.
System: This is a built-in final class in the Java.lang package that provides access to system-level resources.
out: This is a static public field within the System class. It is an instance of the PrintStream class, which provides methods to output data.
println():
The argument to println() can be of various types: strings, numbers, characters, booleans, and even objects (which call their toString() method internally).
System.out.println();
If no argument is passed (as in System.out.println();), it simply prints a newline, moving the output cursor to the next line.
System.out.print()
It differs from System.out.print() in that print() does not advance to the next line after printing.
Top comments (0)