Kotlin Fundamentals
Kotlin is a statically typed programming language used for JVM, Android, web, and native applications. Its concise syntax and explicit nullability help you model application code and handle absent values deliberately.
itProgramming languages | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic - Kotlin Fundamentals
Kotlin is a statically typed language with functions, classes, collections, and control flow. You can target the JVM, Android, the web, or native platforms. The language is not a framework: a useful program also needs a target platform, a build setup, and often libraries.
Kotlin's everyday mental model is types plus explicit intent. A type describes the values an expression can hold. val states that a reference cannot be reassigned. var permits reassignment. Type inference can omit a type annotation when the initializer makes the type clear, but the inferred type remains part of the program contract. Functions may be top-level, members, or local. A main function is a common application entry point.
Nullability is part of the type. String cannot hold null; String? can. Kotlin rejects a direct member access through a nullable receiver, so you must handle the case. The safe-call operator ?. returns null when its receiver is null. The Elvis operator ?: supplies an alternative. A null check can enable a smart cast. Do not use !! as a default: a non-null assertion throws if its value is null.
Classes group state and behavior. Constructor properties can appear in the class declaration. Classes are final by default; mark open only when designed for inheritance. Interfaces describe capabilities. The standard library provides lists, sets, and maps with read-only and mutable interfaces. filter and map build pipelines over collections. Remember that val protects the reference, not necessarily the contents.
Suspending functions and coroutines help structure concurrent work through kotlinx.coroutines. Learn ordinary functions, nullable values, classes, and collections first. Then choose a platform and its tooling.
Read the Intro for null-safety and collections. Use the Cheatsheet when you need the operator and type maps. Updates tracks JetBrains/kotlin releases.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://kotlinlang.org/docs/basic-syntax.html
Supports
- Kotlin applications can use a main function as an entry point
- val cannot be reassigned, var can be reassigned, and Kotlin supports type inference
- Classes can declare constructor properties, classes are final by default, and open permits inheritance
- Kotlin supports lambda-based filter and map collection operations
- https://kotlinlang.org/docs/null-safety.html
Supports
- Kotlin distinguishes nullable and non-nullable types
- Safe calls return null for null receivers and Elvis expressions select an alternative
- Smart casts can follow null checks, safe casts return null on failure, and non-null assertions can throw on null
- https://kotlinlang.org/docs/collections-overview.html
Supports
- Lists are ordered and can repeat elements, sets hold unique elements, and maps have unique keys and mapped values
- Kotlin collection types have read-only and mutable interfaces
- A mutable collection held by val can still support write operations
- https://kotlinlang.org/docs/functions.html
Supports
- Kotlin functions can be top-level, local, members, or extensions
- https://kotlinlang.org/docs/inheritance.html
Supports
- Kotlin classes and members are final by default, open permits inheritance, and override is explicit
- https://kotlinlang.org/docs/coroutines-overview.html
Supports
- Suspending functions can pause and resume without blocking a thread
- Most coroutine features are provided by kotlinx.coroutines and builders run from a CoroutineScope
- https://kotlinlang.org/docs/coroutines-basics.html
Supports
- Documented coroutine work requires a suspending function, a scope, a builder, and a dispatcher
- https://github.com/Heapy/awesome-kotlin
Supports
- Awesome Kotlin is a curated Kotlin ecosystem list; no entry was included without a verified project destination
