开发者

How can I make custom toString for Array?

开发者 https://www.devze.com 2023-02-12 08:58 出处:网络
I want to be able to write: 开发者_Go百科 val a = Array(1,2,3) println(a.toString) And have a meaningfull printout. Is it possible?You have to do this:

I want to be able to write:

开发者_Go百科
val a = Array(1,2,3)
println(a.toString)

And have a meaningfull printout. Is it possible?


You have to 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>
0

精彩评论

暂无评论...
验证码 换一张
取 消