kotlin example
Example 1: how to define variable in kotlin
val firstName: String = "Chike"
val variable name: Typeofthevariable = TheValueofyourvariable
Example 2: kotlin simple for loop
val names = listOf("Jack", "John", "Tim")
for(name in names){
println(name)
}
Example 3: function kotlin
// Declare a function in Kotlin
fun happyBirthday(name: String, age: Int): String {
return "Happy ${age}th birthday, $name!"
}
// Call function
val greeting = happyBirthday("Anne", 32)