Skip to content

Instantly share code, notes, and snippets.

@NitinPraksash9911
Last active March 6, 2020 08:31
Show Gist options
  • Save NitinPraksash9911/789c2deb8cfebcdc5d93fd7fdd40d7cd to your computer and use it in GitHub Desktop.
Save NitinPraksash9911/789c2deb8cfebcdc5d93fd7fdd40d7cd to your computer and use it in GitHub Desktop.
/** Higher Order Function **/
fun funName(a: Int, func: (Int, Int) -> Int) {
val s = func(a,5)
println(s)
}
/** calling above HOF **/
val a: Int = 7
funName(a, {b,c->c+b}). // it will print 12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment