Kotlin has become one of the most relevant programming languages in modern software development. Originally created by JetBrains and officially endorsed by Google for Android development in 2017, Kotlin has grown far beyond mobile. In 2026, over 60% of Android developers use Kotlin as their primary language, and Kotlin Multiplatform (KMP) has matured into a production-ready solution for sharing code across Android, iOS, web, and desktop.
Companies like Netflix, VMware, and Airbnb have adopted Kotlin for production systems, and its combination of conciseness, null safety, and Java interoperability makes it a strong choice for both mobile and server-side development.
For developers looking to enter the Kotlin ecosystem — whether coming from Java, JavaScript, or another language — the first step is building a solid understanding of the language’s syntax, type system, and unique features. That’s where Elements of Kotlin comes in.
About the book
Elements of Kotlin by Mark L. Murphy is a practical introduction to the Kotlin programming language. Published under a Creative Commons license, the book assumes you have prior programming experience — you don’t need to be a Java developer, but you should be comfortable with basic object-oriented concepts.
From there, it guides you through Kotlin’s syntax, type system, collections, functions, classes, and more advanced features like coroutines, extension functions, and Java interoperability.
Written by the founder of CommonsWare, a well-known publisher of Android development books, this title focuses on what you actually need to know to start writing Kotlin code with confidence. It avoids esoteric syntax and stays grounded in practical, everyday usage.
What you will learn
- Kotlin syntax and basic types — numbers, booleans, strings, characters
- Variables, immutability, and type inference with val and var
- Functions, lambdas, and higher-order operations on collections
- Control flow with if, when, and while
- Object-oriented Kotlin — classes, inheritance, interfaces, data classes
- Null safety and nullable types — one of Kotlin’s signature features
- Generics, exceptions, annotations, and scope functions
- Extension functions, property delegates, and DSL building
- Coroutines for structured concurrency
- Java interoperability — calling Java from Kotlin and vice versa
- Changes and new features across Kotlin versions 1.3 and 1.4
Table of contents
- Preface
- Introducing Kotlin — Why Kotlin, what you need to know, getting set up
- A Few “Hello, World!” Examples — Functions, classes, using the Klassbook
- Basic Types and Expressions — Numbers, booleans, strings, characters, equality
- Variables — val vs var, string interpolation, operators
- Functions — Parameters, return types, local variables, fancy functions
- Collections and Lambdas — Lists, sets, maps, immutability, lambda expressions
- If, When, and While — Control flow and expressions
- Basic Classes — Constructors, inheritance, packages, this
- Comments and Documentation — KDoc
- Properties — Initialization, constants, custom accessors
- Visibility and Scope — Public, private, internal, protected
- Abstract Classes and Interfaces
- Data Class, the object Keyword, Nested Objects and Classes
- Enums and Sealed Classes
- Generics — Upper bounds, variance, type parameters
- Exceptions — Catching, raising, checked vs unchecked
- Annotations — Applying and defining
- Nullability — Nullable types, safe calls, the Elvis operator
- Scope Functions — let, apply, run, with, also, use
- Functional Programming — Immutability, function types, sequences
- Extension Functions and Properties
- Java Interoperability — Calling Kotlin from Java and Java from Kotlin
- Changes in Kotlin 1.3 and 1.4
- Property Delegates, Escaping Keywords, Escaped Method Names
- Coroutines — Launch, async, structured concurrency
- Testing — JUnit, Kotlin test, property-based testing
- Getting Started with Klassbook
Book details
- Title: Elements of Kotlin
- Author(s): Mark L. Murphy
- Publication year: 2021
- Publisher: CommonsWare, LLC
- Pages: 413
- PDF size: 1.7 MB
- Estimated reading time: ~10 h 20 min
- Level: Intermediate
- Main category: Programming
- Subcategory: Kotlin
- Language: English
- License: Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
More books in: Kotlin, Programming
Legal notice: This book is shared for educational purposes only. The content is distributed under Creative Commons licenses or with explicit permission from the author. FreeProgrammingBooks may host files that comply with their respective licenses.