Menu
CoddyTech

Hello World!

Part of the Fundamentals section of Coddy's Kotlin journey. Lesson 2 of 93.

The "Hello World!" is a simple program that outputs Hello World! to the screen.

In Kotlin, we use println() to show words on the screen. The words go inside double quotation marks.

Execution of this console program starts in fun main(). Kotlin also allows functions, classes and properties outside main:

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

Note: println() prints the text and moves to a new line. There is also print() which prints without moving to a new line.

challenge icon

Challenge

Beginner

Write a program that prints Hello World!. Type the message between the quotation marks of the println call inside main.

Try it yourself

fun main() {
    println("")  // put the message between the quotes
}
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Fundamentals

Practice on your own: Kotlin playground