In this repository I will document my Kotlin learning process as I read through Kotlin in Action, by Dmitry Jemerov and Svetlana Isakova.
I will try to comment my code and organize it well. I will also try to create README files in each chapter directory to explain which Kotlin files are for which parts of the book. Please make a PR if you find anything to add, modify, or remove.
There is no chapter one in this repository because it is just background information about the Kotlin language.
- Chapter 2: Kotlin basics
- 2.1: Basic elements: functions and variables |
BasicElements.kt
- 2.2: Classes and properties |
ClassesProperties.kt
- 2.3: Representing and handling choices: enums and “when” |
Choices.kt
- 2.4: Iterating over things: “while” and “for” loops |
Iterating.kt
- 2.5: Exceptions in Kotlin |
Exceptions.kt
- 2.1: Basic elements: functions and variables |
- Chapter 3: Defining and calling functions
- 3.1: Creating collections in Kotlin |
Collections.kt
- 3.2: Making functions easier to call |
CallingFunctions.kt
- 3.3: Adding methods to other people’s classes: extension functions and properties |
Extensions.kt
- 3.4: Working with collections: varargs, infix calls, and library support |
WorkingWithCollections.kt
- 3.5: Working with strings and regular expressions |
StringsRegex.kt
- 3.6: Making your code tidy: local functions and extensions |
LocalFunctions.kt
- 3.1: Creating collections in Kotlin |
- Chapter 4: Classes, objects, and interfaces
- 4.1: Defining class hierarchies |
ClassHierarchies.kt
- 4.2: Declaring a class with nontrivial constructors or properties |
NontrivialClasses.kt
- 4.3: Compiler-generated methods: data classes and class delegation |
DataClasses.kt
- 4.4: The “object” keyword: declaring a class and creating an instance, combined |
ObjectKeyword.kt
- 4.1: Defining class hierarchies |
- Chapter 5: Programming with lambdas
- 5.1: Lambda expressions and member references |
LambdaExpressions.kt
- 5.2: Functional APIs for collections |
FunctionalAPIsCollections.kt
- 5.3: Lazy collection operations: sequences |
Sequences.kt
- 5.4: Using Java functional interfaces |
JavaFunctionalInterfaces.kt
- 5.5: Lambdas with receivers: “with” and “apply” |
LambdasWithReceivers.kt
- 5.1: Lambda expressions and member references |
- Chapter 6: The Kotlin type system
- 6.1: Nullability |
Nullability.kt
- 6.2: Primitive and other basic types |
PrimitiveTypes.kt
- 6.3: Collections and arrays |
CollectionsArrays.kt
- 6.1: Nullability |
- Chapter 7: Operator overloading and other conventions
- 7.1: Overloading arithmetic operators |
ArithmeticOperators.kt
- 7.2: Overloading comparison operators |
ComparisonOperators.kt
- 7.3: Conventions used for collections and ranges |
CollectionsRanges.kt
- 7.4: Destructuring declarations and component functions |
Destructuring.kt
- 7.5: Reusing property accessor logic: delegated properties |
DelegatedProperties.kt
- 7.1: Overloading arithmetic operators |
- Chapter 8: Higher-order functions: lambdas as parameters and return values
- 8.1: Declaring higher-order functions |
HigherOrderFunctions.kt
- 8.2: Inline functions: removing the overhead of lambdas |
InlineFunctions.kt
- 8.1: Declaring higher-order functions |