Learn programming with Kotlin! The Kotlin Apprentice is a book designed for complete beginners to Kotlin, a modern language used for Android development. By Irina Galata, Victoria Gonda & Ellen Shapiro.
Who is this for?
For complete beginners to Kotlin. No prior programming experience necessary!
- Kotlin Development Environment
- Numbers and Strings
- Making Decisions
- Functions & Lambdas
- Collection Types
- Building Your Own Types
- Functional Programming
- Kotlin Platforms & Scripting
- Kotlin/Native & Multiplatform
This is a book for complete beginners to the new, modern Kotlin language.
Everything in the book takes place in a clean, modern development environment, which means you can focus on the core features of programming in the Kotlin language,...more
Before You Begin
This section tells you a few things you need to know before you get started, such as what you’ll need for hardware and software, where to find the project files for this book, and more.
Section I: Kotlin Basics
The chapters in this section will introduce you to the very basics of programming in Kotlin. From the fundamentals of how computers work, all the way up to language structures, you’ll cover enough of the language to be able to work with data and organize your code’s behavior.
The section begins with some groundwork to get you started, then you have a chance to do things with your newly learned data types. Finally, you’ll move past the variables and constants you’ve been working with, which have had concrete values, to more tricky data types.
These fundamentals will get you on your way and, before you know it, you’ll be ready for the more advanced topics that follow. Let’s get started!
Section II: Collections & Lambdas
So far, you’ve mostly seen data in the form of single elements. Although pairs and triples can have multiple pieces of data, you’re limited to combining only two or three items with them. In this section, you’ll learn about collection types in Kotlin. Collections are flexible “containers” that let you store any number of values together.
The chapters in this section will give you the foundation that you need to organize your data and code so that you can begin to do more sophisticated programming in Kotlin!
Section III: Building Your Own Types
You can create your own type by combining variables and functions into a new type definition. For example, integers and doubles might not be enough for your purposes, and you might need to create a type to store complex numbers. Or maybe storing first, middle and last names in three independent variables is getting difficult to manage, so you decide to create a FullName type.
When you create a new type, you give it a name; thus, these custom types are known as named types. Named types are a powerful tool for modeling real-world concepts. You can encapsulate related concepts, properties and methods into a single, cohesive model.
Custom types make it possible to build large and complex things with the basic building blocks that you’ve learned so far. It’s time to take your Kotlin apprenticeship to the next level!
Section IV: Intermediate Topics
You’ve made it to the final section of this book! In this section, you’ll delve into some important but more intermediate topics to round out your Kotlin apprenticeship.