方法和函数 定义方法 def m1 (x:Int,y:Int): Int =x+y 定义函数 val f1 = (m:Int,n:Int)=>m+n 将函数当成一个值传进方法中 def m2(f:(Int,Int)=> Int)=f(3,4) 调用时:m2(f1)