Book description
Familiarize yourself with all of Kotlin's features with this in-depth guide
About This Book
- Get a thorough introduction to Kotlin
- Learn to use Java code alongside Kotlin without any hiccups
- Get a complete overview of null safety, Generics, and many more interesting features
Who This Book Is For
The book is for existing Java developers who want to learn more about an alternative JVM language. If you want to see what Kotlin has to offer, this book is ideal for you.
What You Will Learn
- Use new features to write structured and readable object-oriented code
- Find out how to use lambdas and higher order functions to write clean, reusable, and simple code
- Write unit tests and integrate Kotlin tests with Java code in a transitioning code base
- Write real-world production code in Kotlin in the style of microservices
- Leverage Kotlin's extensions to the Java collections library
- Use destructuring expressions and find out how to write your own
- Write code that avoids null pointer errors and see how Java-nullable code can integrate with features in a Kotlin codebase
- Discover how to write functions in Kotlin, see the new features available, and extend existing libraries
- Learn to write an algebraic data types and figure out when they should be used
In Detail
Kotlin has been making waves ever since it was open sourced by JetBrains in 2011; it has been praised by developers across the world and is already being adopted by companies. This book provides a detailed introduction to Kotlin that shows you all its features and will enable you to write Kotlin code to production.
We start with the basics: get you familiar with running Kotlin code, setting up, tools, and instructions that you can use to write basic programs. Next, we cover object oriented code: functions, lambdas, and properties - all while using Kotlin's new features.
Then, we move on to null safety aspects and type parameterization. We show you how to destructure expressions and even write your own. We also take you through important topics like testing, concurrency, microservices, and a whole lot more. By the end of this book you will be able to compose different services and build your own applications.
Style and approach
An easy to follow guide that covers the full set of features in Kotlin programming.
Table of contents
-
Programming Kotlin
- Programming Kotlin
- Credits
- About the Authors
- About the Reviewers
- www.PacktPub.com
- Customer Feedback
- Preface
- 1. Getting Started with Kotlin
- 2. Kotlin Basics
- 3. Object-Oriented Programming in Kotlin
-
4. Functions in Kotlin
- Defining functions
- Single expression functions
- Member functions
- Local functions
- Top-level functions
- Named parameters
- Default parameters
- Extension functions
- Operators
- Function literals
- Tail recursive functions
- Varargs
- Standard library functions
- Generic functions
- Pure functions
- Java from Kotlin
- Kotlin from Java
- Summary
- 5. Higher Order Functions and Functional Programming
- 6. Properties
- 7. Null Safety, Reflection, and Annotations
- 8. Generics
- 9. Data Classes
- 10. Collections
- 11. Testing in Kotlin
- 12. Microservices with Kotlin
- 13. Concurrency
Product information
- Title: Programming Kotlin
- Author(s):
- Release date: January 2017
- Publisher(s): Packt Publishing
- ISBN: 9781787126367
You might also like
book
Programming Kotlin
Programmers don't just use Kotlin, they love it. Even Google has adopted it as a first-class …
video
Advanced Kotlin Programming
Designed for developers who already have a basic understanding of Kotlin, this video course examines some …
video
Introduction to Kotlin Programming
Kotlin 1.0 was released in February 2016, and since that time it’s been embraced by developers …
book
Kotlin in Action
Kotlin in Action guides experienced Java developers from the language basics of Kotlin all the way …