How can System.out.printIn() accept integers?
<p>So I started learning java several days ago and got a question. For the next expression:</p>

<pre><code>String foo=123;
</code></pre>

<p>is not allowed. However, in <code>System.out.printIn()</code>, we can use something like:</p>

<pre><code>int x=5;
System.out.println(x);
</code></pre>

<p>Since implicitly assigning a integer to a string is not allowed, why the expression above works? Anyone can give a detailed explanation? I'm also wondering when can we use this kind of  implicit thing and when we cannot.</p>
