代码改变世界

随笔档案-2014年09月

使用enum建立简单的状态机

2014-09-09 13:13 by Rollen Holt, 2497 阅读, 收藏, 编辑
摘要: ##OverviewThe enum in Java is more powerful than many other languages which can lead to surprising uses.In this article, I outline some the individual... 阅读全文

Scala高阶函数示例

2014-09-02 10:36 by Rollen Holt, 2297 阅读, 收藏, 编辑
摘要: object Closure { def function1(n: Int): Int = { val multiplier = (i: Int, m: Int) => i * m multiplier.apply(n, 2) ... 阅读全文