title: Scala updating Array elements
body: <p>I never thought I would be asking such a simple question but how do I update array element in scala</p>
  
  <p>I have declared inner function inside my Main object and I have something like this</p>
  
  <pre><code>object Main
  {
      def main(args: Array[String])
      {
          def miniFunc(num: Int)
          {
              val myArray = Array[Double](num)
              for(i &lt;- /* something*/)
                  myArray(i) = //something
          }
      }
  }
  </code></pre>
  
  <p>but I always get an exception, Could someone explain me why and how can I solve this problem?</p>