title: Why is this Scala code with assignment of a val in a parameter working?
body: <pre><code>object Main {
  
    def main(args: Array[String])
    {
      val x = 10
      print(x="Hello World")
      print(x)
    }
  }
  </code></pre>
  
  <blockquote>
    <p>output : Hello World10</p>
  </blockquote>
  
  <p>As we know, in Scala a <code>val</code> cannot be reassigned or changed, but here <code>x</code> is changing to</p>
  
  <blockquote>
    <p>Hello World</p>
  </blockquote>
  
  <p>while printing.</p>