Use mkString
object Permutations extends App { Array(1,2,3).combinations(2).foreach(x => println(x.mkString(", "))) }
Scala REPL
scala> Array(1,2,3).combinations(2).foreach(x => println(x.mkString(", "))) 1, 2 1, 3 2, 3
When array instance is directly used for inside println. The toString method of array gets called and results in output like [I@49097b5d. So, use mkString for converting array instance to string.
Scala REPL
scala> println(Array(1, 2)) [I@2aadeb31 scala> Array(1, 2).mkString res12: String = 12 scala> Array(1, 2).mkString(" ") res13: String = 1 2 scala>