写一个两个数字相加的方法
fun sum(x: Int, y: Int): Int {
return x + y
}
fun sum(x: Int, y: Int) = x + y
val i = { x: Int, y: Int -> x + y }
var j: (Int, Int) -> Int = { x, y -> x + y }
写一个两个数字相加的方法
fun sum(x: Int, y: Int): Int {
return x + y
}
fun sum(x: Int, y: Int) = x + y
val i = { x: Int, y: Int -> x + y }
var j: (Int, Int) -> Int = { x, y -> x + y }