开发者

How can I make custom toString for Array?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜