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 6. Properties

We touched upon properties briefly in Chapter 3, Object Oriented Programming in Kotlin. In this chapter, we will take a detailed look at them. You will learn about

  • General properties

  • Visibility

  • Lazy and late initialized

  • Delegated properties

  • When to use properties instead of methods

Furthermore, we will see how to use a Kotlin property from Java and we'll take a peek at the bytecode produced to understand what the compiler does. If you are familiar with C#, the information presented here will be familiar, after all the concept of properties was brought in from the .NET world.