java 8 lambda 教程
java 8 lambda Concise syntax – More succinct and clear than anonymous inner classes • Deficiencies with anonymous inner classes – Bulky, confusion re “this” and naming in general, no nonfinal vars, hard to optimize • Convenient for new streams library – shapes.forEach(s -> s.setColor(Color.RED)); • Similar constructs used in other languages – Callbacks, closures, map/reduce idiom • Step toward true functional programming
用户评论
不错,真是雪中送炭!