有沒有另一種方式使這項工作?作爲斯卡拉默認的第一個參數
def b(first:String="hello",second:String) = println("first:"+first+" second:"+second)
b(second="geo")
如果我打電話只用方法:
b("geo")
我得到:
<console>:7: error: not enough arguments for method b: (first: String,second: String)Unit.
Unspecified value parameter second.
b("geo")
def b(second:String)= b(「hello」,second) – tuxSlayer 2011-04-27 09:51:09