A Few “Hello, World!” Examples

Let’s start looking at some basic “hello, world!” bits of Kotlin code, and along the way see how you can run this code in the Klassbook or elsewhere.

Just the Statement

  println("hello, world!")

The above code snippet is a simple Kotlin statement, one that prints “hello, world!” somewhere.

Below the code snippet, you will see a link. If you are in an ebook reader that supports links, you can click it to visit the Klassbook page corresponding to that code snippet:

Klassbook, Showing a Lesson
Klassbook, Showing a Lesson

If you click the “Run” button, the results of running the Kotlin code will appear below the code in the browser:

Klassbook, Showing the Results
Klassbook, Showing the Results

Prev Table of Contents Next

This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.