Skip to content

Instantly share code, notes, and snippets.

View NitinPraksash9911's full-sized avatar
🎯
Focusing

Nitin Prakash NitinPraksash9911

🎯
Focusing
View GitHub Profile
/** 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
/** Higher Order Function **/
fun funName(a: Int, func: (Int) -> Int) {
val s = func(a)
println(s)
}
/** normal function **/
fun methodName(data: String) {
println(data)
}
/** lambda expression **/
val test = {data:String-> println(data) }