article banner (priority)

Exercise: Your first program

Your task is to create a program that will print "Hello, World" to the console and then check what was the code compiled to on JVM.

  1. Install IntelliJ IDEA if you do not have it yet.
  2. Create a new Kotlin project.
  3. Create a new Kotlin file.
  4. Create a main function using Live Template "main".
  5. Use the println function to print "Hello, World" to the console.
  6. Run the program using the Run button (gutter icon).
  7. Check the output in the Run tool window.
  8. Select "Show Kotlin Bytecode" from the Tools > Kotlin menu.
  9. Click "Decompile" in the Kotlin Bytecode window.
  10. Check the output, and compare this generated Java file with the original Kotlin code.