Book Image

Programming Kotlin

Book Image

Programming Kotlin

Overview of this book

Quickly learn the fundamentals of the Kotlin language and see it in action on the web. Easy to follow and covering the full set of programming features, this book will get you fluent in Kotlin for Android.
Table of Contents (20 chapters)
Programming Kotlin
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Customer Feedback
Preface

Chapter 4. Functions in Kotlin

In the previous chapters, we introduced the basics of Kotlin and how to write procedural and object-oriented code. The emphasis in this chapter will be on functions; how to take the first steps into functional programming; and the features that Kotlin supports, which makes programming with functions easier.

In this chapter, we will cover the following topics:

  • Functions and function literals

  • Extension functions

  • Named parameters and default parameters

  • Operator overloading

  • Recursion and tail recursion