好吧,我想将一个方法保存到var中以便稍后调用它.我想要这样的东西:
class A { def sayHello() { "Hello" } } def a = new A() def sayHelloMethod = a.sayHello def result = sayHelloMethod()
有没有办法做到这一点?