网站介绍:文章浏览阅读36次。object HanShu { def opt(x:Int,y:Int,f:(Int,Int)=>Int)={ f(x,y) } def main(args: Array[String]): Unit = { println(opt(1, 3, (x1, x2) => x1 + x2)) println(opt(1, 3, (x1, x2) => x1 * x2)) }}object HanShu2 { def opt(x:String,
- 链接地址:https://blog.csdn.net/DearNingning/article/details/117636570
- 链接标题:scala之高阶函数-CSDN博客
- 所属网站:blog.csdn.net
- 被收藏次数:4801
- 网站标签:scala之高阶函数