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 visibility modifiers (private, internal, protected, public) in Kotlin classes?

In Kotlin, visibility modifiers control where classes, properties, functions, and constructors can be accessed from. The main visibility modifiers are: public private protected internal If you do not specify a visibility modifier, Kotlin uses public by default. 1. public public means the declaration can be accessed from anywhere. class User { public val name: String […]

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

How do I implement interfaces and use multiple inheritance in Kotlin?

In Kotlin, interfaces define a contract that classes can implement. Kotlin supports multiple inheritance of interfaces, but not multiple inheritance of classes. 1. Defining an interface An interface can declare: abstract properties abstract functions functions with default implementations interface Drivable { val maxSpeed: Int fun drive() fun stop() { println("Stopping the vehicle") } } Here: […]

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

How do I use class inheritance with open and override in Kotlin?

In Kotlin, classes and members are final by default, so you must explicitly mark them as open if you want them to be inherited or overridden. Basic class inheritance open class Animal { open fun makeSound() { println("Some sound") } } class Dog : Animal() { override fun makeSound() { println("Bark") } } Usage: fun […]

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

How do I use the init block to run setup logic in Kotlin classes?

In Kotlin, an init block runs setup logic when a class instance is created. It is commonly used to validate constructor arguments, initialize derived properties, or perform other construction-time setup. class User(val name: String, val age: Int) { init { require(name.isNotBlank()) { "Name must not be blank" } require(age >= 0) { "Age must be […]

Wayan · 2 menit baca
KOTLIN / CATATAN</>
Kotlin20 Jun 2026

How do I override the toString(), equals(), and hashCode() methods in Kotlin?

In Kotlin, you usually don’t manually override toString(), equals(), and hashCode() if your class is just a value/data holder. Use a data class instead. data class User( val id: Int, val name: String ) Kotlin automatically generates: toString() equals() hashCode() copy() componentN() Example: val a = User(1, "Alice") val b = User(1, "Alice") println(a) // […]

Wayan · 2 menit baca
KOTLIN / CATATAN</>
Kotlin19 Jun 2026

How do I use data classes in Kotlin to store structured data?

In Kotlin, data classes are designed to store structured data with minimal boilerplate. A data class automatically provides useful functions such as: toString() equals() hashCode() copy() component functions for destructuring, like component1(), component2() Basic example data class User( val id: Int, val name: String, val email: String ) You can create and use it like […]

Wayan · 2 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.