Last active
March 6, 2020 08:31
-
-
Save NitinPraksash9911/789c2deb8cfebcdc5d93fd7fdd40d7cd 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
/** 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