Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Collections in Kotlin
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Harri Kirik
April 02, 2018
Programming
44
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Collections in Kotlin
5-minute talk about collections in Kotlin
Harri Kirik
April 02, 2018
More Decks by Harri Kirik
See All by Harri Kirik
Secure programming techniques: Mobile Development Security guest lecture
harri35
0
95
Support for HSM-like capabilities in Android
harri35
0
170
Why doesn't my in-app QR code work (on location)?
harri35
0
57
Git merge-base
harri35
1
90
Smoke testing your library
harri35
0
39
Data classes in Kotlin
harri35
0
45
How to do delegation in Kotlin
harri35
0
46
Two-factor authentication at GDG Riga
harri35
0
87
Two-factor authentication at GDG Tartu
harri35
0
68
Other Decks in Programming
See All in Programming
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
280
TanStack Vue Query と Pinia Colada から学ぶ非同期状態の型設計
aoshi
0
620
AmebaブログはKMPから卒業します
kmars0605
0
330
DroidKnights 2026 Android A2UI Jetpack Compose 기반의 안전한 AI UI 렌더링 - 박제창
itsmedreamwalker
1
190
Modernizing iOS Apps
seyfoyun
0
150
Zero-Tap Sign-In対応、結局何をすればいいの?
mitohato14
0
1.6k
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
120
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
180
AI時代のTerminal環境を UNIX哲学で設計・運用する
yasunori0418
1
340
Web Framework Benchmark Battle 2026, Any%
a_matsuda
3
3.1k
AI Augmentation Techniques with Liberty
ivargrimstad
1
380
Optunaを作ったときにやりたかったこと、その後 (2026/10/16, Optuna Meetup #3)
iwiwi
4
1.5k
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Skip the Path - Find Your Career Trail
mkilby
1
280
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
740
Thoughts on Productivity
jonyablonski
76
5.5k
Become a Pro
speakerdeck
PRO
31
6.4k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
570
The Pragmatic Product Professional
lauravandoore
37
7.5k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
560
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
48k
Un-Boring Meetings
codingconduct
0
490
A Tale of Four Properties
chriscoyier
163
24k
Transcript
designing & developing for mobile Demoday, 05/03/2018 Harri Kirik, engineer
Kotlin: Collections
Kotlin KOTLIN: COLLECTIONS #kotlin
Mutable and immutable KOTLIN: COLLECTIONS #collections
Autogenerated: 1. equals()/hashCode() pair 2. toString() 3. componentN() functions 4.
copy() function KOTLIN: COLLECTIONS #collections
KOTLIN: COLLECTIONS val numbers: MutableList<Int> = mutableListOf(1, 2, 3) val
readOnlyView: List<Int> = numbers println(numbers) // prints "[1, 2, 3]" numbers.add(4) println(readOnlyView) // prints "[1, 2, 3, 4]" readOnlyView.clear() // -> does not compile val strings = hashSetOf("a", "b", "c", "c") assert(strings.size == 3) #demoday
No dedicated syntax KOTLIN: COLLECTIONS #collections
listOf(), mutableListOf(), setOf(), mutableSetOf() KOTLIN: COLLECTIONS #collections
KOTLIN: COLLECTIONS val mutable = mutableListOf(1, 2, 3) val snapshot
= mutable.toList() mutable.add(4) println(mutable) // prints "[1, 2, 3, 4]" println(snapshot) // prints "[1, 2, 3]" #demoday
KOTLIN: COLLECTIONS val mutable = mutableListOf(1, 2, 3) val snapshot
= mutable.toList() snapshot.add(4) // Will not compile! val snapshot2 = snapshot.plus(4) // Returns a new list println(snapshot2 ) // prints "[1, 2, 3, 4]" #demoday
http:// lab.mobi designing & developing for mobile thanks Questions?