Printing array in Scala

arrays, scala

Solution

`mkString` will convert collections (including `Array`) element-by-element to string representations.

println(a.mkString(" "))

is probably what you want.

Problem

I am having problem with most basic Scala operation and it is making me crazy. ``` val a = Array(1,2,3) println(a) and result is [I@1e76345 println(a.toString()) and result is [I@1e76345 println(a.toString) and result is [I@1e76345 ``` Can anyone tell me how to print array without writing my own function for doing that because that is silly. Thanks!

Original source

Related problems