Kotlin tutorial
Write concise, typed code for JVM applications.
Course contents
Programming fundamentals
Kotlin Basics
Use values and string templates.
Kotlin Lists
Process an ordered collection.
Kotlin Functions
Declare typed parameters and a return type.
Kotlin when Expressions
Choose a result from several conditions with when.
Kotlin null safety
Distinguish nullable from non-null types, and use ?., ?:, let, and !! deliberately.
Kotlin collections and higher-order functions
Filter, map, group, sort, and fold lists with lambdas instead of loops.
Object-oriented programming
Kotlin Classes
Declare a class with a primary constructor and private state.
Kotlin data classes and sealed interfaces
Model alternatives with a sealed hierarchy and let the compiler check that every case is handled.
Kotlin object, companion object, and delegation
Create singletons, class-level factories with private constructors, and reuse behaviour by delegating to an interface.
Data structures and algorithms
Kotlin sorting and binary search
Sort lists with sorted and sortedBy, and find a value or its insertion point with binarySearch.
Kotlin ArrayDeque as a stack and a queue
Check balanced brackets with a stack and serve items in arrival order with a queue.
Kotlin maps: counting and indexing
Count words with groupingBy and build a lookup map with getOrPut.