scala中的作业评估为Unit有什么原因吗?
var s:String = null
s = "hello" // works
s += " world"
(s = "hello") += " world" // dramatic problem
或者括号有什么魔力?
scala中的作业评估为Unit有什么原因吗?
var s:String = null
s = "hello" // works
s += " world"
(s = "hello") += " world" // dramatic problem
或者括号有什么魔力?