Kotlin · Beginner

Kotlin Fundamentals

Learn Kotlin, Google's recommended language for Android: variables, null safety, functions, classes, collections and coroutines, with runnable examples in your browser.

Units
5
Lessons
20
Practice questions
65
Minutes
~300

Start learning today

Try every course free for 7 days. After that, this course is in Learnix Pro (KES 699/month).

Create free account Log in

What you'll learn

Write and run Kotlin programs in the browser

Use val/var, types, when-expressions and loops

Avoid crashes with Kotlin's null safety

Model data with classes, data classes and sealed classes

Transform collections with map, filter and lambdas

Understand coroutines for background work

How the lessons work

Clear explanations

Step-by-step lessons in plain language

35 in this course

Worked examples

Real code and examples you can copy and run

39 in this course

Quick checks

Test your understanding as you go

45 in this course

Fill the blank

Recall the key commands and syntax

20 in this course

Hands-on workspace

A practical task at the end of every lesson

20 in this course

Syllabus

  1. 1.1

    Why Kotlin and Your First Program

    Kotlin is the language Google recommends for Android. Meet it, run your first program in the browser and see why developers love how little code it needs.

  2. 1.2

    val, var and Types

    Kotlin separates values that never change from ones that do, and figures out most types for you. Learn the core types and safe conversions.

  3. 1.3

    Strings, Templates and Reading Input

    Build readable text with string templates, clean and format input, and read what the user types, safely, without crashing on bad input.

  4. 1.4

    if, when and Loops

    In Kotlin, if and when are expressions that return values: cleaner than Java's switch. Loop with ranges and collections.

  1. 2.1

    Null Safety: Goodbye NullPointerException

    The most common crash in Java apps is calling something on null. Kotlin's type system makes that mistake almost impossible, learn ?, ?., ?: and !!.

  2. 2.2

    Functions, Default Arguments and Lambdas

    Write concise functions with default and named arguments, single-expression bodies, extension functions and lambdas: used constantly in Android click handlers.

  3. 2.3

    Extension Functions and Scope Functions

    Add your own methods to existing types like String and Int, and use let, apply, also, run and with: the idioms you will see on every line of Android code.

  1. 3.1

    Classes, Data Classes and Objects

    Model your app's data. Kotlin gives you primary constructors, properties, data classes with free equals/toString/copy, and singleton objects.

  2. 3.2

    Interfaces, Inheritance and Sealed Classes

    Share behaviour with interfaces and open classes, and model screen states safely with sealed classes: a pattern used in almost every modern Android app.

  3. 3.3

    Enums and Generics

    Model fixed choices with enum classes, and write classes and functions that work with any type, safely. Both appear constantly in Android state handling.

  4. 3.4

    Collections: List, Map and Powerful Operations

    Kotlin's collection functions (map, filter, groupBy, sumOf, sortedBy) turn loops into one readable line. You will use them in every screen that shows a list.

  5. 3.5

    Files and Dates

    Keep data after the program closes by reading and writing files, and do date maths (due dates, ages, late fees) correctly with java.time.

  1. 4.1

    Errors and Coroutines

    Handle failures with try/catch and runCatching, and meet coroutines: Kotlin's way to do slow work (network, database) without freezing the app.

  2. 4.2

    Flow: Streams of Values Over Time

    A suspend function returns one value; a Flow delivers many, over time: live prices, download progress, search results as you type. Flow and StateFlow drive modern Android screens.

  3. 4.3

    Packages, Gradle and Testing

    Organise a real project into packages, add libraries with Gradle, and write automated tests with kotlin.test so you can change code without fear.

  4. 4.4

    Mini Project: A Shop Cart in Kotlin

    Combine data classes, collections, null safety and errors in one small program: the same model code you will plug into an Android app next.

  1. 5.1

    Value Classes, Delegation & Operator Overloading

    Make illegal states impossible with value classes, reuse behaviour with delegation, and write expressive code with operators.

  2. 5.2

    Structured Concurrency: async, Scopes & Cancellation

    Run work in parallel with async/await, keep coroutines tidy with scopes, handle failures and cancel work that is no longer needed.

  3. 5.3

    Calling APIs: Ktor Client & kotlinx.serialization

    Fetch and send JSON from Kotlin with the Ktor client and type-safe serialization, handling errors properly.

  4. 5.4

    Build a Small REST API with Ktor Server

    Use Kotlin on the server: routes, JSON, validation and status codes, creating the backend your Android app talks to.

Earn a verifiable certificate

Finish every lesson and pass the 20-question final exam (70% to pass). Each certificate has a unique number anyone can check online.

Get started

Helping with:

🍪 We use essential cookies to keep you signed in, protect your account and remember your settings. We don't use advertising or tracking cookies. Read our Privacy Policy.