Chrysolites Tech Academy

Video by freeCodeCamp.org · streamed from YouTube. All rights remain with the creator.

Lesson 3: Kotlin: A Modern Typed Language

About this lesson

This lesson is a long, thorough course in Kotlin, the language behind most modern Android apps and a growing amount of server software. It is arranged in six parts. The first part sets up the tools, explains how Kotlin code runs on the Java Virtual Machine and then covers the fundamentals: declaring variables, letting the compiler infer types, the basic number and text types, branching with when, loops, and the null safety rules that stop a whole family of crashes. The second part deals with functions and collections, including default arguments, functions that accept any number of values, lambdas, arrays, lists, sets and maps, a binary search, and handling errors. Part three is object-oriented programming in the Kotlin style: constructors, initialisation blocks, data classes, sealed classes, companion objects, singletons, delegation and extension functions. Part four is a deep look at generics, covering variance, bounds on type parameters and reified types. Part five introduces coroutines for doing several things at once, with launching, awaiting results, structured concurrency, timeouts, cancellation and switching context. The final part covers flows, which deliver streams of values over time, along with their operators, error handling, retries and lifecycle concerns. The later parts are demanding, so beginners should finish Chapter 1 of this book first. Afterwards, read Chapter 3 of the course book, which explains the reasoning behind these features with a compiler diagram, a null safety table and a timing chart.

Install Chrysolites Tech Academy

Android / Chrome / Edge: open the browser menu and choose Install app or Add to Home screen.

iPhone / iPad (Safari): tap the Share button, then Add to Home Screen.