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</>
Kotlin24 Jun 2026

How do I use destructuring with maps and pairs in Kotlin?

In Kotlin, destructuring lets you unpack values from an object into separate variables. It is commonly used with: Pair Map.Entry loops over maps lambda parameters Destructuring a Pair A Pair<A, B> contains two values: first and second. val pair = "Alice" to 25 val (name, age) = pair println(name) // Alice println(age) // 25 This […]

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

How do I use associateBy, partition, and zip in Kotlin?

In Kotlin, associateBy, partition, and zip are collection operations that help transform or split collections. associateBy associateBy creates a Map from a collection by choosing a key for each element. data class User(val id: Int, val name: String) val users = listOf( User(1, "Alice"), User(2, "Bob"), User(3, "Charlie") ) val usersById = users.associateBy { user […]

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

How do I group and count elements using groupBy and count in Kotlin?

In Kotlin, you can group elements with groupBy, then count how many items are in each group. Basic example val words = listOf("apple", "banana", "apricot", "blueberry", "avocado") val countsByFirstLetter = words .groupBy { it.first() } .mapValues { (_, words) -> words.count() } println(countsByFirstLetter) Output: {a=3, b=2} Here: groupBy { it.first() } groups words by their […]

Wayan · 1 menit baca
KOTLIN / CATATAN</>
Kotlin24 Jun 2026

How do I transform nested collections using flatMap in Kotlin?

In Kotlin, flatMap is used to transform each element into a collection and then flatten the results into a single list. Basic idea val result = items.flatMap { item -> // return a collection for each item } It is similar to: items.map { … }.flatten() but more concise. Example: flatten nested lists val nested […]

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

How do I use map, filter and foreach with Kotlin collections?

In Kotlin collections: map transforms each element into a new value. filter keeps only elements that match a condition. forEach performs an action for each element. map: transform elements Use map when you want to create a new collection by changing each item. val numbers = listOf(1, 2, 3, 4) val doubled = numbers.map { […]

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.