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
- Setting Up Kotlin: REPL, IntelliJ & Online Playground
- val vs var: Immutability From Day One
- Kotlin Basic Types: Int, Double, Boolean, Char
- Your First Kotlin Program: main, println & Input