-
Notifications
You must be signed in to change notification settings - Fork 23
Returning Function
Devrath edited this page Feb 10, 2024
·
2 revisions
Output
Start of Main program
PERFORM FUNCTIONALITY
End of Functionality
End of Main program
Code
fun main(args: Array<String>) {
println("Start of Main program")
displayResult {
println("End of Functionality")
}
println("End of Main program")
}
fun displayResult(endFunction:()->Unit){
println("PERFORM FUNCTIONALITY")
endFunction()
}