Answers for "kotlin syntax"

1

kotlin variable in string

//Kotlin variable in string

//variables go in a ${} in a string, example
println("Happy ${age}th birdthday, ${name}!"
Posted by: Guest on October-08-2020
1

kotlin syntax

fun main(args : Array<String>) { 
  println("Hello World") 
}
Posted by: Guest on September-08-2021
1

kotlin syntax

val x = 5
val y = 6
println(x + y) // Print the value of x + y
Posted by: Guest on September-08-2021
3

!! in kotlin

//The not-null assertion operator
val l = b!!.length
Posted by: Guest on September-05-2020
1

return type in kotlin function

//Function having two Int parameters with Int return type
fun sum(a: Int, b: Int): Int {
    return a + b
}
Posted by: Guest on March-18-2020

Browse Popular Code Answers by Language