Book description
Kotlin is a statically typed programming language designed to interoperate with Java and fully supported by Google on the Android operating system.
Based on Big Nerd Ranchs popular Kotlin Essentials course, and written for Kotlin 1.4, this guide shows you how to work effectively with the Kotlin programming language through hands-on examples and clear explanations of key Kotlin concepts and foundational APIs.
Whether you are an experienced Android developer looking for modern features beyond what Java offers or a new developer ready to learn your first programming language, the authors will guide you from first principles to advanced usage of Kotlin. By the end of this book, you will be empowered to create reliable, concise applications in Kotlin.
Table of contents
- Title Page
- Dedication
- Acknowledgments
- Table of Contents
- Introducing Kotlin
- I. Getting Started
-
II. Basic Syntax
- 3. Conditionals
-
4. Functions
- Extracting Code to Functions
- Anatomy of a Function
- Calling a Function
- Writing Your Own Functions
- Default Arguments
- Single-Expression Functions
- Unit Functions
- Named Function Arguments
- For the More Curious: The Nothing Type
- For the More Curious: File-Level Functions in Java
- For the More Curious: Function Overloading
- For the More Curious: Function Names in Backticks
- 5. Numbers
- 6. Strings
- 7. Null Safety and Exceptions
-
III. Introduction to Functional Programming and Collections
-
8. Lambda Expressions and the Function Type
- Introducing NyetHack
- Anonymous Functions
- Lambda Expressions
- Type Inference Support
- More Effective Lambdas
- Defining a Function That Accepts a Function
- Function Inlining
- Lambdas and the Kotlin Standard Library
- For the More Curious: Function References
- For the More Curious: Capturing Lambdas
- Challenge: New Titles and Moods
-
9. Lists and Sets
- Lists
- Iteration
- Reading a File into a List
- Destructuring
- Sets
- while Loops
- Collection Conversion
- For the More Curious: Array Types
- For the More Curious: Read-Only vs Immutable
- For the More Curious: The break Expression
- For the More Curious: Return Labels
- Challenge: Formatted Tavern Menu
- Challenge: Advanced Formatted Tavern Menu
- 10. Maps
-
11. Functional Programming Basics
- Transforming Data
- Filtering Data
- Combining Data
- Why Functional Programming?
- Sequences
- For the More Curious: Profiling
- For the More Curious: Aggregating Data
- For the More Curious: The vararg Keyword
- For the More Curious: Arrow.kt
- Challenge: Reversing the Values in a Map
- Challenge: Finding the Most-Liked Menu Item
- 12. Scope Functions
-
8. Lambda Expressions and the Function Type
-
IV. Object-Oriented Programming
- 13. Classes
- 14. Initialization
- 15. Inheritance
-
16. Objects, Data Classes, and Enums
- The object Keyword
- Nested Classes
- Data Classes
- Enumerated Classes
- Operator Overloading
- Exploring the World of NyetHack
- For the More Curious: Defining Structural Comparison
- For the More Curious: Algebraic Data Types
- For the More Curious: Value Classes
- Challenge: More Commands
- Challenge: Implementing a World Map
- Challenge: Ring the Bell
- 17. Interfaces and Abstract Classes
-
V. Advanced Kotlin
- 18. Generics
- 19. Extensions
- 20. Coroutines
- 21. Flows
- 22. Channels
- VI. Interoperation and Multiplatform Applications
- 27. Afterword
- Glossary
- Index
Product information
- Title: Kotlin Programming: The Big Nerd Ranch Guide, 2nd Edition
- Author(s):
- Release date: October 2021
- Publisher(s): Big Nerd Ranch Guides
- ISBN: 9780136870494
You might also like
book
Kotlin Programming: The Big Nerd Ranch Guide, First Edition
Kotlin is a statically typed programming language designed to interoperate with Java and fully supported by …
book
Android Programming: The Big Nerd Ranch Guide, 4th Edition
Android Programming: The Big Nerd Ranch Guide is an introductory Android book for programmers with Kotlin …
book
Programming Kotlin
Programmers don't just use Kotlin, they love it. Even Google has adopted it as a first-class …
book
Android Programming: The Big Nerd Ranch Guide, 5th Edition
Android Programming: The Big Nerd Ranch Guide is an introductory Android book for programmers with Kotlin …