Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun main() {
- printName("Hello","World") // calling the lamda fucnction
- demo("Just a demo")// calling the simple function
- }
- val printName:(String,String)->Unit={ // inside the (), two arguments, after -> return type
- message,msg->println("$message $msg") // here message, msg are arguments and after -> return statement
- }
- fun demo(name:String):Unit{
- println("It's just a demo of kotlin function\n$name" ) // to remember simple kotlin function :)
- }
Add Comment
Please, Sign In to add comment