In Kotlin, classes and their methods are the primary way to structure code. Unlike Go, Kotlin doesn’t have a separate concept of structs and methods. Instead, methods are always associated with classes.
Kotlin doesn’t distinguish between value and pointer receivers as Go does. The language handles object references and method dispatch internally, so you don’t need to worry about whether you’re dealing with an object or a reference to an object when calling methods.
Kotlin also provides properties, which can replace simple getter and setter methods, making the code more concise and idiomatic.
Next, we’ll look at Kotlin’s mechanism for defining abstract types and behaviors: interfaces.