Introduction to Kotlin

Execution order

fun main() {
  println("I will be printed first.")
  println("I will be printed second.")
  println("I will be printed third.")
}

Notes

// this is a single line comment
/\*
this
note
for
many
\*/

Print statement

println("Greetings, earthling!")
print("Take me to ")
print("your leader.")
/\*
Print:
Greetings, earthling!
Take me to your leader.
\*/

main()

fun main() {
  println("Greetings, QuickRef.ME!")
  // Code goes here
}

The main() function is the starting point of every Kotlin program and must be included in the code before execution

Comments