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 Ranch's popular Kotlin Essentials course, 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. Written for Kotlin 1.2, this book will also introduce you to JetBrains' IntelliJ IDEA development environment.
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
- Cover Page
- Title Page
- Dedication
- Acknowledgments
- Table of Contents
- Introducing Kotlin
- 1. Your First Kotlin Application
- 2. Variables, Constants, and Types
- 3. Conditionals
-
4. Functions
- Extracting Code to Functions
- Anatomy of a Function
- Calling a Function
- Refactoring to Functions
- 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
- Challenge: Single-Expression Functions
- Challenge: Fireball Inebriation Level
- Challenge: Inebriation Status
- 5. Anonymous Functions and the Function Type
- 6. Null Safety and Exceptions
- 7. Strings
- 8. Numbers
- 9. Standard Functions
- 10. Lists and Sets
- 11. Maps
- 12. Defining Classes
- 13. Initialization
- 14. Inheritance
-
15. Objects
- 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
- Challenge: “Quit” Command
- Challenge: Implementing a World Map
- Challenge: Ring the Bell
- 16. Interfaces and Abstract Classes
- 17. Generics
-
18. Extensions
- Defining Extension Functions
- Generic Extension Functions
- Extension Properties
- Extensions on Nullable Types
- Extensions, Under the Hood
- Extracting to Extensions
- Defining an Extensions File
- Renaming an Extension
- Extensions in the Kotlin Standard Library
- For the More Curious: Function Literals with Receivers
- Challenge: toDragonSpeak Extension
- Challenge: Frame Extension
- 19. Functional Programming Basics
- 20. Java Interoperability
- 21. Building Your First Android Application with Kotlin
- 22. Introduction to Coroutines
- 23. Afterword
- A. More Challenges
- Glossary
- Index
Product information
- Title: Kotlin Programming: The Big Nerd Ranch Guide, First Edition
- Author(s):
- Release date: July 2018
- Publisher(s): Big Nerd Ranch Guides
- ISBN: 9780135165188
You might also like
book
Kotlin Programming: The Big Nerd Ranch Guide, 2nd 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
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 …
book
Learning Java, 4th Edition
Java is the preferred language for many of today’s leading-edge technologies—everything from smartphones and game consoles …