我将函数表达式声明为 val:
val greeting = {
println("what the hello1")
println("what the hello2")
}
然后,我想这样称呼它:
greeting
但是,当我调用它时,什么都没有打印。有任何想法吗?
我将函数表达式声明为 val:
val greeting = {
println("what the hello1")
println("what the hello2")
}
然后,我想这样称呼它:
greeting
但是,当我调用它时,什么都没有打印。有任何想法吗?