scala学习----柯里化
摘要:
1、鸭子类型,走起来像鸭子,叫起来像鸭子,就是鸭子。函数中使用{ def close(): Unit }作为参数类型,因此任何含有此函数的类都可以作为参数传递。好处是不必使用继承特性。 1 def withClose(closeAble: { def close(): Unit }, 2 op: { 阅读全文
posted @ 2016-03-02 16:22 psycho_xc 阅读(400) 评论(0) 推荐(0) 编辑