Leanpub Header

Skip to main content

Kotlin Essentials

Kotlin Essentials

Want to learn how to use Kotlin? This practical course presents the most important Kotlin features, together with the best practices for using them.

The instructor is letting you choose the price you pay for this course!

Pick Your Price...
About

About

About the Course

Kotlin is a powerful language, largely thanks to its expressive syntax, intuitive and null-safe type system, and great tooling support. In this course, we cover the essentials of Kotlin, so you can start developing with this amazing programming language. We show nearly everything you need to know in clear and executable code examples.

Price

Course Price

Minimum price

$24.00

$34.00

You pay

$34.00

Author earns

$27.20
$

All prices are in US $. You can pay in US $ or in your local currency when you check out.

EU customers: prices exclude VAT, which is added during checkout.

...Or Buy With Credits!

Number of credits (Minimum 1)

1
The author will earn $48.00 from your purchase!
You can get credits monthly with a Reader Membership

Instructor

About the Instructor

Marcin Moskała

Marcin Moskala is an experienced developer and Kotlin trainer. He is the founder of the kt.academy, Kotlin GDE, an official JetBrains partner for teaching Kotlin, and author of the books Effective Kotlin, Kotlin Coroutines, and Android Development with Kotlin.

Leanpub Podcast

Episode 254

An Interview with Marcin Moskała

Material

Course Material

  • Notes about the course

  • Project with exercises

  • Quiz 1

    3 attempts allowed

  • Introduction

  • What is Kotlin?

  • Kotlin platforms

  • The Kotlin IDE

  • Where do we use Kotlin?

  • Quiz 2

    3 attempts allowed

  • Your first program in Kotlin

  • Live templates

  • What is under the hood on JVM?

  • Packages and importing

  • Summary

  • Quiz 3

    3 attempts allowed

  • Exercise: Your first program

  • Quiz 4

    100 attempts allowed

  • Variables

  • Quiz 5

    3 attempts allowed

  • Basic types, their literals and operations

  • Numbers

  • Underscores in numbers

  • Other numeral systems

  • Number and conversion functions

  • Operations on numbers

  • Operations on bits

  • BigDecimal and BigInteger

  • Booleans

  • Equality

  • Boolean operations

  • Characters

  • Strings

  • Summary

  • Quiz 6

    3 attempts allowed

  • Exercise: Basic values operations

  • Quiz 7

    100 attempts allowed

  • Conditional statements: if, when, try, and while

  • if-statement

  • when-statement

  • when-statement with a value

  • is check

  • Explicit casting

  • Smart-casting

  • While and do-while statements

  • Summary

  • Quiz 8

    3 attempts allowed

  • Exercise: Using when

  • Quiz 9

    100 attempts allowed

  • Exercise: Pretty time display

  • Quiz 10

    100 attempts allowed

  • Functions

  • Single-expression functions

  • Functions on all levels

  • Parameters and arguments

  • Unit return type

  • Vararg parameters

  • Named parameter syntax and default arguments

  • Function overloading

  • Infix syntax

  • Function formatting

  • Summary

  • Quiz 11

    3 attempts allowed

  • Exercise: Person details display

  • Quiz 12

    100 attempts allowed

  • The power of the for-loop

  • Ranges

  • Break and continue

  • Use cases

  • Summary

  • Quiz 13

    3 attempts allowed

  • Exercise: Range Operations

  • Quiz 14

    100 attempts allowed

  • Nullability

  • Safe calls

  • Not-null assertion

  • Smart-casting

  • The Elvis operator

  • Extensions on nullable types

  • null is our friend

  • lateinit

  • Summary

  • Quiz 15

    3 attempts allowed

  • Exercise: User Information Processor

  • Quiz 16

    100 attempts allowed

  • Classes

  • Member functions

  • Properties

  • Constructors

  • Classes representing data in Kotlin and Java

  • Inner classes

  • Summary

  • Quiz 17

    3 attempts allowed

  • Exercise: Implementing the Product class

  • Quiz 18

    100 attempts allowed

  • Inheritance

  • Overriding elements

  • Parents with non-empty constructors

  • Super call

  • Abstract class

  • Interfaces

  • Visibility

  • Any

  • Summary

  • Quiz 19

    3 attempts allowed

  • Exercise: GUI View Hierarchy Simulation

  • Quiz 20

    100 attempts allowed

  • Data classes

  • Transforming to a string

  • Objects equality

  • Hash code

  • Copying objects

  • Destructuring

  • When and how should we use destructuring?

  • Data class limitations

  • Prefer data classes instead of tuples

  • Summary

  • Quiz 21

    3 attempts allowed

  • Exercise: Data class practice

  • Quiz 22

    100 attempts allowed

  • Objects

  • Object expressions

  • Object declaration

  • Companion objects

  • Data object declarations

  • Constant values

  • Summary

  • Quiz 23

    3 attempts allowed

  • Exercise: Pizza factory

  • Quiz 24

    100 attempts allowed

  • Exceptions

  • Throwing exceptions

  • Defining exceptions

  • Catching exceptions

  • A try-catch block used as an expression

  • The finally block

  • Important exceptions

  • The hierarchy of exceptions

  • Summary

  • Quiz 25

    3 attempts allowed

  • Exercise: Catching exceptions

  • Quiz 26

    100 attempts allowed

  • Enum classes

  • Data in enum values

  • Enum classes with custom methods

  • Summary

  • Quiz 27

    3 attempts allowed

  • Exercise: Days of the week enum

  • Quiz 28

    100 attempts allowed

  • Sealed classes and interfaces

  • Sealed classes and when expressions

  • Sealed vs enum

  • Use cases

  • Summary

  • Quiz 29

    3 attempts allowed

  • Annotation classes

  • Meta-annotations

  • Annotating the primary constructor

  • List literals

  • Summary

  • Quiz 30

    3 attempts allowed

  • Extensions

  • Extension functions under the hood

  • Extension properties

  • Extensions vs members

  • Extension functions on object declarations

  • Member extension functions

  • Use cases

  • Summary

  • Quiz 31

    3 attempts allowed

  • Exercise: Conversion and measurement unit creation

  • Quiz 32

    100 attempts allowed

  • Collections

  • The hierarchy of interfaces

  • Mutable vs read-only types

  • Creating collections

  • Lists

  • Modifying lists

  • Checking a list’s size or if it is empty

  • Lists and indices

  • Checking if a list contains an element

  • Iterating over a list

  • Sets

  • Modifying sets

  • Elements in a set are unique

  • Checking a set’s size or if it is empty

  • Checking if a set contains an element

  • Iterating over sets

  • Maps

  • Finding a value by a key

  • Adding elements to a map

  • Checking if a map contains a key

  • Checking map size

  • Iterating over maps

  • Mutable maps

  • Using arrays in practice

  • Arrays of primitives

  • Vararg parameters and array functions

  • Summary

  • Quiz 33

    3 attempts allowed

  • Exercise: Inventory management

  • Quiz 34

    100 attempts allowed

  • Operator overloading

  • An example of operator overloading

  • Arithmetic operators

  • The in operator

  • The iterator operator

  • The equality and inequality operators

  • Comparison operators

  • The indexed access operator

  • Augmented assignments

  • Unary prefix operators

  • Increment and decrement

  • The invoke operator

  • Precedence

  • Summary

  • Quiz 35

    3 attempts allowed

  • Exercise: Money operations

  • Quiz 36

    100 attempts allowed

  • The beauty of Kotlin’s type system

  • What is a type?

  • Why do we have types?

  • The relation between classes and types

  • Class vs type in practice

  • The relationship between types

  • The subtype of all the types: Nothing

  • The result type from return and throw

  • When is some code not reachable?

  • The type of null

  • Summary

  • Quiz 37

    3 attempts allowed

  • Exercise: The closest supertype of types

  • Quiz 38

    100 attempts allowed

  • Generics

  • Generic functions

  • Generic classes

  • Generic classes and nullability

  • Generic interfaces

  • Type parameters and inheritance

  • Type erasure

  • Generic constraints

  • Star projection

  • Underscore operator for type arguments

  • Summary

  • Quiz 39

    3 attempts allowed

  • Exercise: Stock

  • Quiz 40

    100 attempts allowed

  • Exercise solutions

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub