JJUG Java 8 Lambda ハンズオン #jjug
![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
JavaのLambda式=実装すべきメソッドが1つだけのインタフェース(関数的インタフェース)を実装する無名クラスの簡易記述 #jjug
2012-07-25 19:29:23![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
JavaのLambda式は,実装すべきメソッドが1つだけのインターフェースを実装する無名クラスの簡易記述 #jjug
2012-07-25 19:29:28![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
interface Runnable { run(); } interface Comparable<T> { int comparateTo(T o); } #jjug
2012-07-25 19:30:38![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
ぶっちゃけると、Project Lambda は実装すべきメソッドが一つだけのインタフェースを実装する無名クラスの簡易記述。 #jjug
2012-07-25 19:30:38![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
今日はそういえば #jjug だったのだな。待機だから行けないが、人気があれば第二弾もあるかも、とさくらばさんも仰っていたので、皆様盛り上げてくださいな。
2012-07-25 19:31:22![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
interface Comparator<T> { boolean equals(Object obj); int compare(T o1, T o2); } はObject.equals()があるから,関数的とみなせる.#jjug
2012-07-25 19:33:27![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
interface Foo { int m(); Object clone(); } は関数的インターフェースではない,clone()がprotectedで… #jjug
2012-07-25 19:35:11![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
cloneメソッドはprotectedなのでpublicでオーバライドしなければならず、他に実装すべきメソッドがある場合、このインタフェースは関数的インタフェースではない。 #jjug
2012-07-25 19:35:34![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
interface Compator<T> { boolean equals(Object obj); int compare(T o1, T o2); } はequals()がobjectを継承しているため関数的 #jjug
2012-07-25 19:36:34![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
interface Foo{ int m(); Object clone(); } はcloneがprotectedのために関数的なインタフェースではない。 #jjug
2012-07-25 19:36:41![](https://tgfile.tg-static.com/static/web/img/placeholder.gif)
#jjug 「実装すべきメソッドが1つだけの *抽象クラス* を継承した無名クラスのインスタンス」は Lambda 式で書けないよ。
2012-07-25 19:36:47