How can I make custom toString for an array?

I want to write:

val a = Array(1,2,3) println(a.toString) 

And have a full listing. Is it possible?

+4
source share
1 answer

You must do this:

 scala> val a = Array(1, 2, 3) a: Array[Int] = Array(1, 2, 3) scala> println(a.deep) Array(1, 2, 3) scala> 
+7
source

Source: https://habr.com/ru/post/1340309/


All Articles