Skip to content
Learn Netverks

Lesson

Step 1/36 3% through track

intro

Introduction to Kotlin

Last reviewed May 28, 2026 Content v20260528
Track mode
server_compiled
Means
Compiled runner
Reading
~3 min
Level
beginner

This lesson

An orientation to the Kotlin track—how the compiled playground works, core vocabulary, and what you will practice next.

You need a clear map of the Kotlin track so null safety, data classes, coroutines, and JVM interop do not feel like magic.

You will apply Introduction to Kotlin in contexts like: Android apps, Spring services, and shared KMP modules.

Write Kotlin in main.kt with fun main(), click Run on server—the dev runner kotlinc compiles to a JVM jar and java runs it; use println for output (requires JDK + kotlinc; LEARNING_RUNNER_ENABLED=true). Also read the interview prep blocks.

After the Java track or strong Java experience—Kotlin is designed as a better Java for JVM and Android teams.

How this Kotlin track works

  • kotlinc in the playground — write a single main.kt with top-level fun main() and println; the dev runner compiles with kotlinc and runs MainKt on the JVM.
  • JVM-first, Android as context — lessons teach Kotlin syntax and stdlib on the JVM. Coroutine lessons use threads or println demos when kotlinx-coroutines is not on the classpath; full runBlocking and Flow appear in Gradle/Android projects locally.
  • Prerequisites — finish Java first for JVM and OOP context. Compare with JavaScript, C#, and Go when choosing stacks.

Kotlin powers Android, Spring Boot, Ktor, and Gradle plugins. Multi-module Gradle, Compose UI, and kotlinx-coroutines run locally—sandbox lessons keep one file without Android SDK imports.

Install on your device (macOS, Linux, Windows)

Kotlin on the JVM needs JDK and the Kotlin compiler.

macOS

  1. brew install openjdk@21 kotlin

Linux

  1. sudo apt install -y openjdk-21-jdk then Kotlin CLI via Snap/SDKMAN or zip from GitHub releases.

Windows

  1. winget install Microsoft.OpenJDK.21 and install Kotlin from kotlinlang.org.

Verify: kotlinc -version and java -version.

Run code on this site (Backend & language playgrounds)

  1. Clone or open this project locally; copy .env.example to .env.
  2. Ensure LEARNING_RUNNER_ENABLED=true and LEARNING_RUNNER_URL=http://127.0.0.1:9999/v1/execute.
  3. Terminal 1: php artisan serve (or composer run dev for Laravel + Vite + runner together).
  4. Terminal 2: npm run runner — keep it running while you click Run on server.

Kotlin is a modern, statically typed language that runs on the JVM, compiles to JavaScript, and targets native platforms. JetBrains designed it for concise syntax, null safety, and first-class coroutines—making it the preferred language for new Android apps and a growing choice for server-side Spring services.

How this track differs from Java and Python

After the Java track, you know classes, interfaces, and JVM bytecode. Kotlin targets the same JVM but removes boilerplate, adds null-safe types, and treats functions as values. Compared to Python, Kotlin is statically typed with inference—more like C# than dynamic scripting.

Unlike browser-first JavaScript, this track focuses on JVM Kotlin with kotlinc in the playground. Android UI lessons appear as a teaser—full Android SDK work runs locally with Gradle.

What you will learn

  • Syntax: variables, strings, control flow, functions, and null safety
  • OOP: classes, data classes, inheritance, interfaces, objects, sealed types
  • Collections: lists, maps, sets, lambdas, extensions, generics, delegation
  • Async: exceptions, coroutines, flows, and scope builders
  • Tooling: packages, Gradle, file I/O, testing, Java interop
  • Interview essentials, production habits, and Android context

Playground setup

This topic uses server_compiled: your code compiles with kotlinc as a single main.kt file. Use fun main() and println for output—the JVM entry class is MainKt. We recommend finishing Java first for JVM and OOP context.

Important interview questions and answers

  1. Q: What is Kotlin best known for?
    A: Concise JVM syntax, null safety, coroutines, Android adoption, and seamless Java interop.
  2. Q: Does Kotlin replace Java on the JVM?
    A: Kotlin compiles to JVM bytecode and calls Java libraries directly—teams often mix both languages in one project.

Self-check

  1. In one sentence, why do Android teams prefer Kotlin?
  2. Why do we recommend Java fundamentals before this track?

Tip: Finish Java first—Kotlin builds on JVM classes with null safety and coroutines.

Interview prep

What is Kotlin in one sentence?

A modern statically typed JVM language with null safety, coroutines, and strong Java interop—default for new Android apps.

Why learn Kotlin after Java?

Java teaches JVM and OOP; Kotlin adds concise syntax, null-safe types, and coroutines while reusing Java libraries.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs on the configured server runner (dev: npm run runner with LEARNING_RUNNER_ENABLED=true). Output appears below the editor.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • Why Kotlin after Java?
  • Android or server goal?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump