Key Concepts

Review core concepts you need to learn to master this subject

The main() Function

fun main() { // Code goes here }

The main() function is the starting off point of every Kotlin program and must be included in the code before execution.

Introduction to Kotlin
Lesson 1 of 1
  1. 1
    Welcome to the world of coding with Kotlin! Kotlin is a programming language that, after its release in 2016 by JetBrains, quickly gained popularity amongst develope…
  2. 2
    What better way to start learning about Kotlin than to run a Kotlin program? Before we run our first program, let’s take a moment to understand our current environment. Code is written and edited …
  3. 3
    Think of writing code like going on an adventure: we always need to start somewhere. In Kotlin, the journey begins in the main() function. The main() function is the “jumping off” point for our …
  4. 4
    In the last exercise, we were able to display the text Coding is fun! in the output terminal with the following code: fun main() { println(“Coding is fun!”) } We accomplished this feat using a p…
  5. 5
    Similar to instructions in a recipe, code is read, compiled, and executed in a top-down order. When we run a program, a compiler translates our Kotlin co…
  6. 6
    Documenting what our code is accomplishing is a good programming practice because it makes our code understandable for both the programmer and anyone else who reads it. Comments allow us to wri…
  7. 7
    While every programmer is different, there is one experience we all share: getting an error message. An error, or bug, causes our programs to behave in unexpected ways. When we receive an error me…
  8. 8
    In programming, formatting conventions are the suggested rules for how code should be structured in a specific programming language. By following Kotlin’s formatting standards, or coding convention…
  9. 9
    Great job completing the first lesson on learning Kotlin! Let’s go over all the content we have discussed: * Kotlin is a general-purpose programming language. * The main() function is the starting …

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo