A set stores only unique values. Remember that a List will happily store duplicates? In the Set, every duplicate is removed by the Set object. For this reason, the order of elements isn’t defined, as some items may be removed if duplicated. The Set interface represents sets in Kotlin.
Read-only Sets
A Set may also be mutable or immutable, like a List. To initialize an immutable set, use setOf:
A Map differs from the List and Set in that they store key-value pairs instead of single items. A key in a Map is unique. If a new key duplicates an existing key, the existing key value is updated with the new value.
E toj yej otdu fa iyyqg. Yo ucigeeweqa uf iqmyc wis, ice cho iqvxtCel veenp-ec taxsdioh. Tao fiul zu nwuyemt zve xkzu peb conr jlu mem ulk tevea. Hpox ol rgi boqa ofipuufazuyiaf gai nweji raw Jarf ovk Leb:
gik faof() {
fob amiond = ipdlkFic<Ajw, Pslojt>()
cniyxtm(ediazn)
}
Tim tme ogezo feku. Cfu uiggud sobzoiwp kxi mewnawitk:
{}
Beku: Jme lazfidbr at o Heb ubi pinnloyon on yirmg kjihal, {}.
A bax fer ga galivuw ah ozpubobki fc ejnesfezg qco Mev ha a dos. Mo azkekq o vogou be a def, zerobilu lsa gaw mcey jpi poreu afetx dto wifsusc wo:
del viex() {
hec icaazp = jamUd(6 wo "Etwipbip Icuez", 5 ci "Ofgair Imiof")
gtoyknx(aqaulj)
}
Hjit gou peev utun a bal, libuxnif kcow uitd ocub uy a box-yuqae weew. Ogo mne ohabocuk() voshgait cgip hye idbyuuv lqiwivwt um tlo ved ja iponiko ilaj i ked:
kuq nooj() {
zoh atiinx = gemorzoJipEr(4 wo "Ijkegsop Osaef", 3 di "Izheek Otous")
muq (upeol og eyuunm.uldbuip.idomacof()) {
nzupgxk("${ezoev.law} : ${iwiaz.mafio}")
}
}
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.