Created
September 19, 2015 02:09
-
-
Save yyYank/9f8cee6d3b59dcc5c9bf to your computer and use it in GitHub Desktop.
むずかしい
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main(args : Array<String>) { | |
// JavaのFunctoinのSAMはこんな感じな気がする | |
val func = java.util.function.Function<Int, Int>{ a -> a + 1} | |
val result = func.apply(1) | |
println(result) | |
// こんなんも微妙 | |
val res = FuncExecutor("hogehoge").execute{ | |
a -> "hogehogehogeohoge" | |
} | |
} | |
// 微妙なクラス | |
class FuncExecutor(val a : String) { | |
fun execute (f : (a : String) -> String) { | |
java.util.function.Function<String, String>{ | |
f(a) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment