About this Sample
This is a free sample of the book Atomic Kotlin. The book is available in both eBook and print form at www.AtomicKotlin.com.
This sample contains a limited number of full atoms (chapters) and partial atoms.
This sample is copyrighted and is subject to the same restrictions as the full book, with the exception that you can freely share this sample.
Leanpub
Before purchasing the book, you are strongly encouraged to install this sample on your reading device of choice to ensure that you have no problems.
This sample (and the complete book) is available in multiple eBook formats:
- PDF for reading on computers; includes hyperlinked references to other atoms.
- MOBI for reading on Kindle devices, or the Kindle app.
- EPUB for reading on iPads and other Apple devices (or computer EPUB readers).
- You can also read the book, in your browser, directly from the Leanpub site.
Leanpub provides instructions on how to install an eBook onto your device:
We have tested the eBook on these platforms:
- iPad (Open the EPUB file using the Safari browser, then select “Open in iBooks”).
- Kindle Fire (See above link).
- Kindle Paperwhite (See above link).
- Google Play Books (Add the EPUB file to your Books library).
Stepik
Stepik provides a separate, browser-based eBook product which allows you to interactively edit, compile and run the inline book examples directly within your browser, as long as you have an Internet connection. The interactive eBook (with its own free sample) can be found here: Stepik. Please note that the Stepik product is not part of the Leanpub product.
Complete Table of Contents
- Copyright
- Section I: Programming Basics
- Introduction
- Why Kotlin?
- Hello, World!
-
var&val - Data Types
- Functions
-
ifExpressions - String Templates
- Number Types
- Booleans
- Repetition with
while - Looping & Ranges
- The
inKeyword - Expressions & Statements
- Summary 1
- Section II: Introduction to Objects
- Objects Everywhere
- Creating Classes
- Properties
- Constructors
- Constraining Visibility
- Packages
- Testing
- Exceptions
- Lists
- Variable Argument Lists
- Sets
- Maps
- Property Accessors
- Summary 2
- Section III: Usability
- Extension Functions
- Named & Default Arguments
- Overloading
-
whenExpressions - Enumerations
- Data Classes
- Destructuring Declarations
- Nullable Types
- Safe Calls & the Elvis Operator
- Non-Null Assertions
- Extensions for Nullable Types
- Introduction to Generics
- Extension Properties
-
break&continue - Section IV: Functional Programming
- Lambdas
- The Importance of Lambdas
- Operations on Collections
- Member References
- Higher-Order Functions
- Manipulating Lists
- Building Maps
- Sequences
- Local Functions
- Folding Lists
- Recursion
- Section V: Object-Oriented Programming
- Interfaces
- Complex Constructors
- Secondary Constructors
- Inheritance
- Base Class Initialization
- Abstract Classes
- Upcasting
- Polymorphism
- Composition
- Inheritance & Extensions
- Class Delegation
- Downcasting
- Sealed Classes
- Type Checking
- Nested Classes
- Objects
- Inner Classes
- Companion Objects
- Section VI: Preventing Failure
- Exception Handling
- Check Instructions
- The
NothingType - Resource Cleanup
- Logging
- Unit Testing
- Section VII: Power Tools
- Extension Lambdas
- Scope Functions
- Creating Generics
- Operator Overloading
- Using Operators
- Property Delegation
- Property Delegation Tools
- Lazy Initialization
- Late Initialization
- Appendices
- Appendix A: AtomicTest
- Appendix B: Java Interoperability