Kotlin has a number of features where specific language constructs are implemented by calling functions that you define in your own code. You already may be familiar with these types of constructs from Java, where objects that implement the java.lang.Iterable interface can be used in for loops and objects that implement the java.lang.AutoCloseable interface can be used in try-with-resources statements.
In Kotlin, such features are tied to functions with specific names (and not bound to some special interfaces in the standard library, like they are in Java). For example, if your class defines a special method named plus, then by convention, you can use the + operator on instances of this class. Because of that, in Kotlin, we refer to this technique as conventions. In this chapter, we’ll look at different conventions supported by Kotlin and how they can be used.