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.
- Install IntelliJ IDEA if you do not have it yet.
- Create a new Kotlin project.
- Create a new Kotlin file.
- Create a
main
function using Live Template "main". - Use the
println
function to print "Hello, World" to the console. - Run the program using the Run button (gutter icon).
- Check the output in the Run tool window.
- Select "Show Kotlin Bytecode" from the Tools > Kotlin menu.
- Click "Decompile" in the Kotlin Bytecode window.
- Check the output, and compare this generated Java file with the original Kotlin code.
Marcin Moskala is a highly experienced developer and Kotlin instructor as the founder of Kt. Academy, an official JetBrains partner specializing in Kotlin training, Google Developers Expert, known for his significant contributions to the Kotlin community. Moskala is the author of several widely recognized books, including "Effective Kotlin," "Kotlin Coroutines," "Functional Kotlin," "Advanced Kotlin," "Kotlin Essentials," and "Android Development with Kotlin."
Beyond his literary achievements, Moskala is the author of the largest Medium publication dedicated to Kotlin. As a respected speaker, he has been invited to share his insights at numerous programming conferences, including events such as Droidcon and the prestigious Kotlin Conf, the premier conference dedicated to the Kotlin programming language.