title: How does System.out.print() work?
body: <p>I have worked with Java for a quite a long time, and I was wondering how the function <code>System.out.print()</code> works.</p>
  
  <p>Here is my doubt:</p>
  
  <p>Being a function, it has a declaration somewhere in the <strong>io</strong> package. But how did Java developers do that, since this function can take in any number of arguments and any argument types no matter how they are arranged? e.g:</p>
  
  <pre><code>System.out.print("Hello World");
  System.out.print("My name is" + foo);
  System.out.print("Sum of " + a + "and " + b + "is " + c);
  System.out.print("Total USD is " + usd);
  </code></pre>
  
  <p>No matter what is the datatype of variables <code>a, b, c, usd, foo</code> or how they are passed, <code>System.out.print()</code> never throws an error.</p>
  
  <p>For me, I have never worked on any project where the requirement was like this. Provided, if I get a requirement like this, I really don't know how to solve it.</p>
  
  <p>Can anyone explain to me how it's done?</p>