Created
February 14, 2020 12:55
-
-
Save emregoren/d499021dd45ade4cbe9a82216fe95bfc 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() { | |
val higherOrderFunction = { surName: String -> "surName : $surName" } | |
val anonymousFunction = fun(surName: String): String { return "surName : $surName" } | |
printUserInfo("EMRE", higherOrderFunction, 20) | |
printUserInfo("EMRE", anonymousFunction, 20) | |
printUserInfo("EMRE", fun(surName: String): String { | |
return "surName : $surName" | |
}, 20) | |
} | |
fun printUserInfo(name: String, getSurName: (surName: String) -> String = { "" }, age: Int): Unit { | |
println("name: $name , age : $age") | |
println(getSurName("GÖREN")) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment