title: Method being executed out of order in Scala
body: <p>I don't know what am I missing , may be its something minor, but here is the problem</p>
  
  <p>println() is being called out of order.
  i.e. Output that I get is </p>
  
  <p>Line two.</p>
  
  <p>Line one</p>
  
  <p>Shouldn't it be reversed?</p>
  
  <p>I do know that that "Line two" is out of main method, but what is the reason,
  I tried searching, but couldn't get to the bottom.</p>
  
  <pre><code>object oneToTen {
      def main(args: Array[String]): Unit = {
      println("Line one")
    }
  
    println("Line two.")
  }
  </code></pre>