最近看Spark的東西,因爲以前沒有接觸過lambda函數表達式,因此搜了點資料,特意紀錄在此java
1
|
(argument)
=
>
//funtion body
|
1
|
(s
1
:
String, s
2
:
String)
=
> s
1
.length - s
2
.length
|
1
2
3
4
|
val
outer
=
10
val
myFuncLiteral
=
(y
:
Int)
=
> y * outer
val
result
=
myFuncLiteral(
2
)
>
20
|