Ruang penulis
SEBUAH JURNAL TENTANG TEKNOLOGI

Belajar hal baru.
Tulis. Bagikan.

Ruang untuk merangkai pengetahuan, satu baris kode setiap hari.
Temukan tutorial, ide, dan catatan dari perjalanan belajar.

1914 catatan & terus bertumbuh
PILIHAN EDITOR
Java

Memahami Java Stream: olah koleksi dengan lebih ringkas

Pelajari alur filter, map, dan collect untuk mengolah data Java dengan kode yang mudah dibaca.

D Tim Diary Coding · 1 menit baca
UNTUK RASA INGIN TAHUMU

Catatan terbaru.

KOTLIN / CATATAN</>
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 menit baca
KOTLIN / CATATAN</>
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 menit baca
KOTLIN / CATATAN</>
Kotlin21 Jun 2026

How do I use object expressions and object declarations in Kotlin?

Object expressions vs. object declarations in Kotlin Kotlin has two closely related features: Object expressions: create an anonymous object immediately. Object declarations: create a named singleton object. They both use the object keyword, but they are used for different purposes. 1. Object expressions Use an object expression when you need a one-off object, often to […]

Wayan · 4 menit baca
KOTLIN / CATATAN</>
Kotlin21 Jun 2026

How do I create and use companion objects for static-like behavior in Kotlin?

In Kotlin, a companion object is an object declared inside a class that can hold members callable on the class itself, giving you static-like behavior. Kotlin does not have Java-style static members directly. Instead, you usually use companion object. Basic example class User(val name: String) { companion object { const val DEFAULT_NAME = "Guest" fun […]

Wayan · 3 menit baca
KOTLIN / CATATAN</>
Kotlin21 Jun 2026

How do I use inner and nested classes in Kotlin?

In Kotlin, classes can be declared inside other classes in two main ways: Nested classes — default behavior Inner classes — declared with the inner keyword Nested classes A class declared inside another class is nested by default. class Outer { class Nested { fun message(): String { return "Hello from Nested" } } } […]

Wayan · 3 menit baca
KOTLIN / CATATAN</>
Kotlin21 Jun 2026

How do I use abstract classes and methods in Kotlin?

In Kotlin, an abstract class is a class that cannot be instantiated directly. It is meant to be subclassed. An abstract method is a method declared without an implementation. Subclasses must override it. Basic example abstract class Animal { abstract fun makeSound() fun sleep() { println("Sleeping…") } } class Dog : Animal() { override fun […]

Wayan · 3 menit baca

Pengetahuan tumbuh ketika dibagikan.

Simpan rasa ingin tahu. Selalu ada hal baru untuk dipelajari.

Jelajahi catatan ↗
Putu Adi Guna Permana
TENTANG PENULIS

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

Penulis dan pendiri Diary Coding — berbagi catatan, tutorial, dan pengalaman seputar pemrograman untuk siapa pun yang ingin terus belajar.