SupportWriter space ↗
REFERENCE LIBRARY

References from other publishers

Republished articles with source attribution. This collection is separate from Diary Coding’s original guides and does not display ads.

Read original guides → · Editorial policy

FOR YOUR CURIOSITY

Latest notes.

KOTLIN / NOTES</>↗
Kotlin21 Jun 2026

How do I use delegation by `by` keyword to implement interfaces or properties in Kotlin?

In Kotlin, the by keyword is used for delegation. It lets one object delegate behavior to another object instead of implementing everything manually. There are two common forms: Interface/class delegation Property delegation 1. Interface delegation If a class implements an interface, it can delegate the implementation of that interface to another object using by. Example […]

Wayan · 6 min read
KOTLIN / NOTES</>↗
Kotlin21 Jun 2026

How do I write custom getters and setters in Kotlin properties?

In Kotlin, properties can have custom getters and setters by defining get() and/or set(value) directly under the property. var propertyName: Type = initialValue get() { return field } set(value) { field = value } field is the backing field automatically generated by Kotlin when needed. Custom getter class Person( val firstName: String, val lastName: String […]

Wayan · 2 min read
KOTLIN / NOTES</>↗
Kotlin21 Jun 2026

How do I use sealed classes for exhaustive type-safe hierarchies in Kotlin?

In Kotlin, sealed classes (and sealed interfaces) let you model a closed, type-safe hierarchy: a fixed set of known subtypes. This is especially useful for things like UI state, results, commands, events, and domain-specific alternatives. Basic idea A sealed class restricts which classes can inherit from it. sealed class Result data class Success(val data: String) […]

Wayan · 5 min read
KOTLIN / NOTES</>↗
Kotlin21 Jun 2026

How do I use enums and associate data or behavior in Kotlin?

In Kotlin, enum class is used for a fixed set of constants. Enums can have: simple constants constructor parameters / associated data properties functions overridden behavior per constant companion object utilities implemented interfaces Basic enum enum class Direction { NORTH, SOUTH, EAST, WEST } Usage: val direction = Direction.NORTH when (direction) { Direction.NORTH -> println("Going […]

Wayan · 5 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.