0Pricing
Kotlin Academy · Lesson

Your First Kotlin Program: main, println & Input

Write a complete Hello World, read console input, and print formatted output.

The main Function

Every standalone Kotlin program starts at fun main(). The JVM calls this function when the program launches.

fun main() {
    // your code here
}

Hello, World

The classic first program. println writes a line of text to the console followed by a newline.

fun main() {
    println("Hello, World!")
}

All lessons in this course

  1. Setting Up Kotlin: REPL, IntelliJ & Online Playground
  2. val vs var: Immutability From Day One
  3. Kotlin Basic Types: Int, Double, Boolean, Char
  4. Your First Kotlin Program: main, println & Input
← Back to Kotlin Academy