例1: 此时没有写返回值,但是有等号,函数会自己推断返回值,此时的返回值是Int
def add(x:Int, y:Int) = { x+y}例2: 此时没有写返回值,也没有等号,无论函数内部有没有返回值,返回值都是Unit
def add(x:Int, y:Int){ x+y}