title: Scala - printing arrays
body: <p>It seems like the support for printing arrays is somewhat lacking in Scala.  If you print one, you get the default garbage you'd get in Java:</p>
  
  <pre><code>scala&gt; val array = Array.fill(2,2)(0)             
  array: Array[Array[Int]] = Array(Array(0, 0), Array(0, 0))
  
  scala&gt; println(array)
  [[I@d2f01d
  </code></pre>
  
  <p>Furthermore, you cannot use the Java toString/deepToString methods from the java.util.Arrays class: (or at least I cannot figure it out)</p>
  
  <pre><code>scala&gt; println(java.util.Arrays.deepToString(array))
  &lt;console&gt;:7: error: type mismatch;
   found   : Array[Array[Int]]
   required: Array[java.lang.Object]
         println(java.util.Arrays.deepToString(array))
  </code></pre>
  
  <p>The best solution I could find for printing a 2D array is to do the following:</p>
  
  <pre><code>scala&gt; println(array.map(_.mkString(" ")).mkString("\n"))
  0 0
  0 0
  </code></pre>
  
  <p>Is there a more idiomatic way of doing this?  </p>