variables kotlin code example
Example 1: kotlin variable
val name = ”Marcin” // Can't be changed
var age = 5 // Can be changed
age++
Example 2: kotlin variable in string
//Kotlin variable in string
//variables go in a ${} in a string, example
println("Happy ${age}th birdthday, ${name}!"
Example 3: how to define variable in kotlin
val firstName: String = "Chike"
val variable name: Typeofthevariable = TheValueofyourvariable