The classic first thing you learn in a programming language is how to print "hello, world!".
In Kotlin, printing to the "standard output" (e.g., the JavaScript console, Android Logcat) is via a call to println()
.
The line shown in this lesson prints "hello, world!". If you click the "Expand" button, though, and look at the entire
Kotlin script, you will see that it is a main()
function that contains our println()
call.
In Klassbook, the main()
function is what gets executed when you click the "Run" button to
run the code.
In fact, click "Run" now, and you will see "hello, world!" appear beneath the Kotlin code.
You can learn more about this in:
Tags: