![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
scala
full-stack-coder
爱好踢足球,各种体育运动
展开
-
scala学习
http://ofps.oreilly.com/titles/9780596155957/原创 2012-05-08 17:22:51 · 111 阅读 · 0 评论 -
scala闭包
有这样一个函数, 它接受一个函数(或者说闭包)作为参数:object Timer{ def oncePerSecond(callback: () => unit): unit = { while (true){ callback() Thread.sleep(1000) } } def timeFlies(): unit = { Console....原创 2012-05-08 17:43:02 · 140 阅读 · 0 评论