scala函数的call-by-name和call-by-value 区别
def test (x:Int, y:Int )=x*x
test(2,3)
test(3+4,8)
test(7,2*4)
test(2,3) 2*2 4 CBV CBN 执行步骤一样
test(3+4,8) CBV
scala函数的call-by-name和call-by-value 区别
def test (x:Int, y:Int )=x*x
test(2,3)
test(3+4,8)
test(7,2*4)
test(2,3) 2*2 4 CBV CBN 执行步骤一样
test(3+4,8) CBV
微信扫码登录