Kotlin Tutorial #3: Variables, Types, and Type Inference

In the previous tutorial, you installed Kotlin and wrote your first programs. Now let’s learn about variables and types — the building blocks of every Kotlin program. In this tutorial, you will learn: The difference between val and var All basic types in Kotlin How type inference works How to convert between types How to use constants with const val val vs var Kotlin has two keywords for declaring variables: ...

March 19, 2026 · 7 min

Kotlin Tutorial #4: Null Safety — Kotlin's Best Feature

In the previous tutorial, you learned about variables and types. Now let’s learn about null safety — the feature that makes Kotlin truly special. NullPointerException (NPE) is the most common crash in Java and many other languages. Tony Hoare, who invented null references in 1965, called it his “billion-dollar mistake”. Kotlin solves this problem at compile time. ...

March 19, 2026 · 7 min

Kotlin Tutorial #5: Functions, Default Parameters, and Named Arguments

In the previous tutorial, you learned about null safety. Now let’s learn about functions — the building blocks that organize your code into reusable pieces. Kotlin functions are more powerful than Java methods. They support default parameters, named arguments, single-expression syntax, and much more. In this tutorial, you will learn: ...

March 19, 2026 · 7 min

Kotlin Tutorial #6: Control Flow — if, when, for, while

In the previous tutorial, you learned about functions. Now let’s learn about control flow — how to make decisions and repeat actions in your code. Kotlin’s control flow is similar to Java, but with important improvements. if and when are expressions that return values. when replaces switch and is much more powerful. ...

March 19, 2026 · 8 min

Kotlin Tutorial #7: Classes, Objects, and Data Classes

In the previous tutorial, you learned about control flow. Now let’s learn about classes — the foundation of object-oriented programming in Kotlin. Kotlin classes are more concise than Java classes. What takes 50 lines in Java takes 1 line in Kotlin with data classes. In this tutorial, you will learn: ...

March 19, 2026 · 8 min