System.out is just an instance of PrintStream. You can check its JavaDoc. Its variability is based on method overloading (multiple methods with the same name, but with different parameters).

This print stream is sending its output to so called standard output.


In your question you mention a technique called variadic functions (or varargs). Unfortunately that is not supported by PrintStream#print, so you must be mistaking this with something else. However it is very easy to implement these in Java. Just check the documentation.


And if you are curious how Java knows how to concatenate non-string variables "foo" + 1 + true + myObj, it is mainly responsibility of a Java compiler.

When there is no variable involved in the concatenation, the compiler simply concatenates the string. When there is a variable involved, the concatenation is translated into StringBuilder#append chain. There is no concatenation instruction in the resulting byte code; i.e. the + operator (when talking about string concatenation) is resolved during the compilation.

All types in Java can be converted to string (int via methods in Integer class, boolean via methods in Boolean class, objects via their own #toString, ...). You can check StringBuilder's source code if you are interested.


UPDATE: I was curious myself and checked (using javap) what my example System.out.println("foo" + 1 + true + myObj) compiles into. The result:

System.out.println(new StringBuilder("foo1true").append(myObj).toString());
Answer from Pavel Horal on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › java › system-out-println-in-java
System.out.println in Java - GeeksforGeeks
System.out.println() prints the given message to the console and automatically moves the cursor to a new line.
Published   June 2, 2026
Top answer
1 of 9
32

System.out is just an instance of PrintStream. You can check its JavaDoc. Its variability is based on method overloading (multiple methods with the same name, but with different parameters).

This print stream is sending its output to so called standard output.


In your question you mention a technique called variadic functions (or varargs). Unfortunately that is not supported by PrintStream#print, so you must be mistaking this with something else. However it is very easy to implement these in Java. Just check the documentation.


And if you are curious how Java knows how to concatenate non-string variables "foo" + 1 + true + myObj, it is mainly responsibility of a Java compiler.

When there is no variable involved in the concatenation, the compiler simply concatenates the string. When there is a variable involved, the concatenation is translated into StringBuilder#append chain. There is no concatenation instruction in the resulting byte code; i.e. the + operator (when talking about string concatenation) is resolved during the compilation.

All types in Java can be converted to string (int via methods in Integer class, boolean via methods in Boolean class, objects via their own #toString, ...). You can check StringBuilder's source code if you are interested.


UPDATE: I was curious myself and checked (using javap) what my example System.out.println("foo" + 1 + true + myObj) compiles into. The result:

System.out.println(new StringBuilder("foo1true").append(myObj).toString());
2 of 9
3

Even though it look as if System.put.print...() take a variable number of arguments it doesn't. If you look closely, the string is simply concatenated and you can do the same with any string. The only thing that happens is, that the objects you are passing in, are implicitily converted to a string by java calling the toString() method.

If you try to do this it will fail:

int i = 0;
String s = i;
System.out.println(s);

Reason is, because here the implicit conversion is not done.

However if you change it to

int i = 0;
String s = "" + i;
System.out.println(s);

It works and this is what happens when using System.put.print...() as well.

If you want to implement a variable number of arguments in java to mimimc something like C printf you can declare it like this:

public void t(String s, String ... args)
{
    String val = args[1];
}

What happens here is that an array of Strings is passed in, with the length of the provided arguments. Here Java can do the type checking for you.

If you want truly a printf then you have to do it like this:

public void t(String s, Object ... args)
{
    String val = args[1].toString();
}

Then would you have to cast or interpret the arguments accordingly.

Discussions

What is System, out, println in System.out.println() in Java - Stack Overflow
This stream is already open and ready to accept output data. Typically this stream corresponds to display output or another output destination specified by the host environment or user. For simple stand-alone Java applications, a typical way to write a line of output data is: System.out.println(d... More on stackoverflow.com
🌐 stackoverflow.com
Difference between system.out.println() and println()
There is no println() in Java. In Java everything is object oriented and while newer versions have kinda sorta added functions as first-class citizens, it's integration into the SDK is inconsistent. But regardless, it is not possible to import a function directly, you can only import it from a class. So System.out.println() means you're importing println() from a out, which is a static variable on the System class. You have to reference the whole thing because that's how java works. More on reddit.com
🌐 r/learnjava
3
22
November 6, 2021
System.out.print takes forever to run versus System.out.println?
Please ensure that: Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions You include any and all error messages in full - best also formatted as code block You ask clear questions You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions. If any of the above points is not met, your post can and will be removed without further warning. Code is to be formatted as code block (old reddit/markdown editor: empty line before the code, each code line indented by 4 spaces, new reddit: https://imgur.com/a/fgoFFis ) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc. Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit. Code blocks look like this: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } } You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above. If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures. To potential helpers Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
🌐 r/learnjava
4
1
February 14, 2022
Issue where System.out.print() seems to not be printing properly
It may be something to do with your editor. I just ran the code and got Number: 56 More on reddit.com
🌐 r/learnjava
12
14
February 4, 2022
People also ask

What is the Difference Between println() and print()?
The main difference between the two is that print() retains the cursor in the same line after printing the argument, while println() moves the cursor to the next line.
🌐
interviewkickstart.com
interviewkickstart.com › home › blogs › learn › system.out.println in java: how it works, syntax, and examples
System.out.println in Java: Syntax, Examples, and How It Works
What is Method Overloading in the Context of println()?
Method overloading means that a class has multiple methods of the same name but different parameters, so the method can be run for different types or numbers of parameters. For example, in Java, println() is a method that's overloaded to accept all different data types as parameters for printing.
🌐
interviewkickstart.com
interviewkickstart.com › home › blogs › learn › system.out.println in java: how it works, syntax, and examples
System.out.println in Java: Syntax, Examples, and How It Works
What is the Main Difference Between System.out and System.err?
While System.in, System.out, and System.err are all initialized when a Java VM starts by the Java runtime. Also, .out and .err are both a type of PrintSteam. Here, .out prints anything that needs to be printed on the output section. On the other hand, .err almost exclusively is used to print error messages, either separately in the stderr output stream or a different color in IDEs like Eclipse.
🌐
interviewkickstart.com
interviewkickstart.com › home › blogs › learn › system.out.println in java: how it works, syntax, and examples
System.out.println in Java: Syntax, Examples, and How It Works
🌐
Interview Kickstart
interviewkickstart.com › home › blogs › learn › system.out.println in java: how it works, syntax, and examples
System.out.println in Java: Syntax, Examples, and How It Works
April 3, 2026 - System.out.println() is a statement in Java that prints output of code to the console, followed by a new line. It is used to show messages, in user interactions, and in debugging code.
🌐
Medium
medium.com › @AlexanderObregon › how-javas-system-out-println-actually-works-79556a9c2837
How Java’s System.out.println() Actually Works | Medium
February 28, 2025 - Java's System.out.println() interacts with PrintStream, buffers output, and makes system calls. Learn how it works and why it can slow down performance.
🌐
TheServerSide
theserverside.com › blog › Coffee-Talk-Java-News-Stories-and-Opinions › System-out-println-print-Java-meaning-explain-class-PrintStream-String-text
System.out in Java explained
July 27, 2025 - As is often the case in Java, the best way to explain System.out.println(“Hello World”) is to read it from right to left.
Find elsewhere
🌐
W3Schools
w3schools.com › java › java_output.asp
Java Output Values / Print Text
System.out.println("Hello World!"); System.out.println("I am learning Java."); System.out.println("It is awesome!"); Try it Yourself » · Text must be wrapped inside double quotations marks "". If you forget the double quotes, an error occurs: System.out.println("This sentence will work!"); System.out.println(This sentence will produce an error); Try it Yourself » ·
🌐
BeginnersBook
beginnersbook.com › 2021 › 08 › system-out-println-in-java-explained-with-examples
System.out.println() in Java explained with examples
As we know that we need to create the object of a class to invoke its method. Here instead of creating the object of the PrintStream class we use System.out, it internally creates the object of PrintStream class so we can use the statement · System.out.println() to invoke println() method.
🌐
Coderanch
coderanch.com › t › 699012 › java › difference-System-println-System-println
difference between System.out::println and System.out.println (Beginning Java forum at Coderanch)
September 14, 2018 - What you can do however, is pass it to something expecting a λ; it means, “take the standard output object, find its println() method and pass the object you have to it.” It is called a method reference. Read ore about it in the Java™ Tutorials. ... More precisely, System.out::println is called a "method reference" and in a roundabout way, it does get executed.
🌐
Medium
medium.com › @tarekoudir › system-out-print-and-system-out-println-in-java-a-detailed-overview-a85a564d9240
System.out.print() and System.out.println() in Java: A Detailed Overview | by Tarek Oudir | Medium
October 21, 2024 - On the other hand, System.out.println() also prints text to the console, but with one key difference: it automatically moves the cursor to the next line after the output.
🌐
Net Informations
net-informations.com › java › cjava › out.htm
What's the meaning of System.out.println in Java?
What's 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 a class in the java.lang package.
🌐
Medium
medium.com › @hedi.brahim › understanding-system-out-println-in-java-the-basics-of-console-output-c71e35b2301e
Understanding System.out.println in Java: The Basics of Console Output | by Hedi Brahim | Medium
June 9, 2025 - System is a final class from the java.lang package. out is a static member of System, which is a reference to PrintStream, a built-in class for output streams. println() is a method of PrintStream that prints a message followed by a newline.
🌐
Medium
swaroopnadella.medium.com › lets-deep-dive-system-out-println-in-java-c39ff0613874
Let’s deep dive System.out.println in Java | by Swaroop Nadella | Medium
August 30, 2024 - It prints the argument passed to it (such as a string, integer, etc.) to the console, followed by a newline character. The ‘println’ method is overloaded, meaning it can accept different types of arguments (e.g., strings, numbers, characters).
🌐
TutorialsPoint
tutorialspoint.com › system-out-println-in-java
System.out.println in Java
May 15, 2023 - System.out.println is a method in Java that prints a message to the standard output (typically the console) and appends a newline character. It's widely used to display messages, data, and the results of operations during the execution of a program.
🌐
Medium
panditaarchit98.medium.com › system-out-println-in-java-ff1ae9dfa5bc
System.out.println in Java. Know everything about… | by Archit Pandita | Medium
December 15, 2020 - out is static instance of PrintStream class inside System class and println() is method of PrintStream class. System is final class present in java.lang package.out is static instance inside System class of type PrintStream.
🌐
iO Flood
ioflood.com › blog › system-out-println
Java's System.out.println Explained: How does it Work?
February 20, 2024 - The term ‘standard output’ ... is typically the console or screen. The System.out.println command prints the given data to the standard output stream (the console, in most cases)....
🌐
Delft Stack
delftstack.com › home › howto › java › java system.out.println
Java system.out.println() Method | Delft Stack
October 12, 2023 - So, System.out gives us the out instance variable of the PrintStream class. We can then call the print() or println() method on this instance variable.
🌐
GeeksforGeeks
geeksforgeeks.org › java › difference-between-system-out-print-and-system-out-println-function-in-java
Difference Between System.out.print() and System.out.println() Function in Java - GeeksforGeeks
October 7, 2021 - In Java, we have the following functions to print anything in the console. ... But there is a slight difference between both of them, i.e. System.out.println() prints the content and switch to the next line after execution of the statement whereas
🌐
Javapapers
javapapers.com › core-java › system-out-println
System.out.println - Javapapers
June 30, 2015 - System.out.println is a Java statement that prints the argument passed, into the System.out which is generally stdout.