Kotlin Tutorials
48 tutorials across 16 topics. Each lesson includes code examples, a practice exercise, a quiz, and FAQs.
48 tutorials found
What is Kotlin?
Learn what Kotlin is, why it was created, and where it is used. Understand Kotlin basics with simple explanations, code examples, and expected output.
Why Learn Kotlin?
Discover why Kotlin is worth learning in 2026. Understand Kotlin advantages, job market demand, and practical benefits with simple examples.
Kotlin Get Started
Get started with Kotlin in minutes. Write your first program, choose between IntelliJ IDEA and the online Kotlin Playground, and understand project structure.
Kotlin Playground
Use the Kotlin Playground to run Kotlin code online without any installation. Learn how to use the playground for learning and sharing code.
Kotlin Program Structure
Learn how a Kotlin program is structured. Understand packages, imports, top-level functions, and how multiple files work together.
Kotlin main Function
Learn about the Kotlin main function — the program entry point. Understand the signature, command-line arguments, and what happens when main runs.
Kotlin Comments
Learn all three types of Kotlin comments: single-line //, multi-line /* */, and KDoc /** */. Includes examples and best practices.
Kotlin Output with println
Learn how to output text in Kotlin using println, print, and formatted output. Includes string templates, number formatting, and expected output.
Kotlin Input with readln
Learn how to read user input in Kotlin using readln() and readLine(). Includes converting strings to numbers and handling null input.
Kotlin Variables
Learn Kotlin variables with beginner-friendly examples. Understand val, var, type inference, reassignment, common mistakes, and expected output.
Kotlin Data Types
Learn all Kotlin data types with examples and expected output. Covers Int, Double, Float, Long, Boolean, Char, String, and Any.
Kotlin Strings
Learn Kotlin strings from scratch. Covers string declaration, accessing characters, length, concatenation, case conversion, and common string functions.
Kotlin String Templates
Master Kotlin string templates. Learn to use $ for variables and ${} for expressions inside strings, with practical examples and expected output.
Kotlin Raw Strings
Learn how to use Kotlin raw strings with triple quotes """...""". Great for multi-line text, JSON, SQL, and regex patterns without escape sequences.
Kotlin Operators
Learn all Kotlin operators: arithmetic (+,-,*,/,%), comparison (==,!=,<,>), logical (&&,||,!), and bitwise. With examples and output.
Kotlin If / Else
Learn Kotlin if, else if, and else with examples. Covers if as an expression, ternary alternative, and nested conditions.
Kotlin When
Learn the Kotlin when expression — the powerful alternative to switch. Match values, ranges, types, and conditions with examples.
Kotlin For Loop
Learn the Kotlin for loop with ranges, lists, maps, and indices. Includes downTo, step, and withIndex with expected output.
Kotlin While Loop
Learn while and do-while loops in Kotlin with examples and expected output. Understand the difference and when to use each.
Kotlin Ranges
Learn Kotlin ranges: inclusive .., exclusive until, downTo for reverse, and step. Includes character ranges and range checks.
Kotlin Functions
Learn Kotlin functions from scratch. Covers declaration, parameters, return types, single-expression functions, and Unit return.
Kotlin Default Arguments
Learn Kotlin default arguments — declare function parameters with preset values. Skip arguments you do not need to pass.
Kotlin Higher-Order Functions
Learn Kotlin higher-order functions — functions that accept or return other functions. Includes lambdas, function types, and practical examples.
Kotlin List
Learn Kotlin lists. Covers listOf for read-only and mutableListOf for mutable lists, with add, remove, iteration, and filtering.
Kotlin Set
Learn Kotlin Set — an unordered collection of unique elements. Covers setOf, mutableSetOf, contains, and set operations.
Kotlin Map
Learn Kotlin Map — a collection of key-value pairs. Covers mapOf, mutableMapOf, put, get, iterate, and common map operations.
Kotlin Classes
Learn how to create Kotlin classes. Covers primary constructor, properties, methods, instances, and init blocks with examples.
Kotlin Data Classes
Learn Kotlin data classes. They auto-generate equals, hashCode, toString, copy, and componentN functions. Perfect for model objects.
Kotlin Inheritance
Learn Kotlin inheritance. Covers open classes, override, super, abstract classes, and why classes are final by default.
Kotlin Interfaces
Learn Kotlin interfaces. Covers abstract functions, default implementations, multiple interface implementation, and interface properties.
Kotlin Sealed Classes
Learn Kotlin sealed classes. Use them to model restricted sets of states with exhaustive when expressions. Ideal for UI state and API results.
Kotlin Enums
Learn Kotlin enum classes for fixed sets of constants. Covers properties, methods, when expressions, and enum vs sealed class.
Kotlin Companion Object
Learn Kotlin companion objects for factory methods, constants, and static-like APIs without Java static keyword.
Kotlin object Declaration
Learn Kotlin object declarations for singletons, utility holders, and anonymous objects. Thread-safe lazy initialization included.
Kotlin Null Safety
Master Kotlin null safety. Learn nullable types, safe call ?., Elvis operator ?:, not-null assertion !!, and smart casts.
Kotlin Coroutines Introduction
Learn Kotlin coroutines from scratch. Understand what coroutines are, why they exist, and how to use launch, delay, and runBlocking with examples.
Kotlin Lambdas
Learn Kotlin lambdas — anonymous functions. Covers syntax, it parameter, capturing variables, and use with filter, map, forEach.
Kotlin Extension Functions
Learn Kotlin extension functions — add new functions to existing classes without modifying them. Includes String, Int, and custom class extensions.
Kotlin Scope Functions
Learn all 5 Kotlin scope functions: let, run, with, apply, and also. Understand their context object and return value differences with examples.
Kotlin suspend Functions
Learn Kotlin suspend functions. Understand how suspend pauses a coroutine without blocking threads, and when you can call suspend code.
Kotlin launch and async
Learn when to use launch vs async in Kotlin. launch returns a Job; async returns Deferred for results with await().
Kotlin Coroutine Scope
Learn coroutineScope, supervisorScope, and structured concurrency in Kotlin. Cancel parent scopes to stop child coroutines safely.
Kotlin Coroutine Dispatchers
Learn Kotlin Dispatchers.Main, IO, and Default. Use withContext to switch threads for UI, network, and CPU work in coroutines.
Kotlin Try Catch
Learn Kotlin exception handling with try, catch, and finally. Covers custom exceptions, try as expression, and common exception types.
Kotlin Generics
Learn Kotlin generics — generic functions, generic classes, type bounds, and variance (in/out). With practical examples and expected output.
Kotlin Flow Introduction
Learn Kotlin Flow — a cold asynchronous data stream. Covers flow builders, collect, map, filter, flowOn, and the difference from LiveData.
Kotlin StateFlow
Learn Kotlin StateFlow — a hot flow that holds and replays the latest value. Perfect for Android ViewModel and UI state management.
Kotlin SharedFlow
Learn Kotlin SharedFlow for one-time events, broadcast streams, and configurable replay. Compare SharedFlow vs StateFlow for Android.