Elements of Kotlin


The programming language for the first generation of Android app development was Java.

The programming language that will dominate the second generation of Android app development will be Kotlin.

Kotlin is a powerful language, designed to be concise yet expressive, both for application code and for libraries. However, some of that comes at a cost, as Kotlin has a lot more keywords and specialty features than does Java. A lot of that complexity is only needed by intermediate to advanced Kotlin developers, though.

This introductory book to Kotlin focuses on helping existing programmers get up to speed on reading and writing Kotlin code. Particular emphasis is placed on the sorts of syntax and language capabilities that most Kotlin developers will need, with light coverage of the advanced capabilities that allow library developers to create easy-to-use APIs.

Right now, this book is in a very early "beta" state, but it covers most of basics of Kotlin programming. It should reach Version 1.0 in the first half of 2019, with more complete coverage.

This book is published in PDF, EPUB, and MOBI/Kindle formats, for use in your favorite digital book reader. You can also read it online from the Warescription site.

Subscribe for $20 »

The Table of Contents

  • Introducing Kotlin
  • A Few “Hello, World!” Examples
  • Basic Types and Expressions
  • Variables… Whether They Vary or Not
  • Functions
  • Collections and Lambdas
  • If, When, and While
  • Basic Classes
  • Comments and Documentation
  • Properties
  • Visibility and Scope
  • Abstract Classes and Interfaces
  • Data Class
  • The object Keyword
  • Nested Objects and Classes
  • Enums and Sealed Classes
  • Generics
  • Exceptions
  • Annotations
  • Nullability
  • Scope Functions
  • Functional Programming
  • Coroutines
  • Extension Functions
  • Java Interoperability
  • Annotations on Generated Accessors
  • Custom Accessors
  • Escaping Keywords
  • Escaped Method Names
  • Property Delegates
  • Constants
  • Abstract Properties
  • Covariance in Generics
  • Contravariance in Generics
  • Reified Type Parameters
  • Anonymous Functions
  • Inline Functions
profile for CommonsWare at Stack Overflow, Q&A for professional and enthusiast programmers

What's New

  • Initial release!

Details

  • Version 0.1
  • 288 pages
  • Errata