Created
March 6, 2020 08:34
-
-
Save NitinPraksash9911/ac98583a27853aa5d7be523b2d337242 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 funNameTwo(func:(Int)->Int):(Int)->Int{ | |
val k = func(6) | |
return {x:Int->x*k} | |
} | |
/** calling above HOF **/ | |
val test= funNameTwo({it*4}) | |
val s = test(7) | |
println(s) //it will print 168 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment