Skip to content
Learn Netverks

Lesson

Step 2/36 6% through track

what-is-kotlin

What is Kotlin?

Last reviewed Jun 1, 2026 Content v20260601
Track mode
server_compiled
Means
Compiled runner
Reading
~2 min
Level
beginner

This lesson

This lesson teaches What is Kotlin?: the syntax, patterns, and safety habits you need before advancing in Kotlin.

Teams still ship What is Kotlin? in Kotlin codebases—skipping it leaves gaps in debugging and code reviews.

You will apply What is 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).

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

Kotlin is a general-purpose language from JetBrains, open source since 2011 and stable for production on JVM, JS, and Native backends. Google endorsed it for Android in 2017; Spring and Ktor use it on servers.

Core characteristics

  • Static typing with inferenceval count = 10 infers Int; types checked at compile time
  • Null safety — nullable types use ?; the compiler rejects many NPE-prone calls
  • Concise syntax — data classes, properties, and expression-oriented control flow
  • Coroutines — structured concurrency without callback pyramids (full library on Gradle projects)

Typical JVM build-run flow (local)

  1. Write main.kt with fun main()
  2. kotlinc main.kt -include-runtime -d app.jar && java -jar app.jar or use Gradle
  3. Deploy JVM bytecode alongside existing Java libraries

Important interview questions and answers

  1. Q: Is Kotlin garbage collected on JVM?
    A: Yes—same JVM GC as Java; Kotlin adds value types on Native but JVM Kotlin uses heap objects like Java.
  2. Q: Who uses Kotlin in production?
    A: Android apps, Spring Boot services, Gradle plugins, multiplatform shared modules (KMP).

Self-check

  1. What file extension do Kotlin sources use?
  2. Name one major platform where Kotlin is the default language.

Tip: Kotlin source uses .kt files compiled to JVM bytecode—think Android, Spring, and Gradle plugins.

Interview prep

Is Kotlin garbage collected on JVM?

Yes—same JVM GC as Java; Kotlin/JVM uses heap objects like Java.

Who uses Kotlin?

Android, Spring Boot, Ktor, Gradle plugins, and Kotlin Multiplatform shared modules.

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

  • JVM interop how?
  • Null safety one line?

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