Kotlin - Collections

g_choi·2022년 3월 28일
0

TIL

목록 보기
2/4

This article is a summary of the excerpts from tutorialspoint.com

2022-03-27 Today I learned what Kotlin Collections are and how they are used.
Referred to https://www.tutorialspoint.com/kotlin/index.htm

Collections

  1. Kotlin list - List is an ordered collection with access to elements by indices.
  2. Kotlin Set - Set is a collection of unique elements which means a group of objects without repetitions.
  3. Kotlin Map - Map is a set of key-value pairs. Keys are unique, and each of them maps to exactly one value.

Kotlin Collection Types

  • Collection or Immutable Collection → not allowed changing values in a collection.
  • Mutable Collection → allowed changing values in a collection.

Collections

  1. List - listOf(), listOf ()
  2. Map - mapOf()
  3. Set - setOf()

Mutable Collections

  1. List - ArrayList(), arrayListOf(), mutableListOf()
  2. Map - HashMap, hashMapOf(), mutableMapOf()
  3. Set - hashSetOf(), mutableSetOf()
profile
해외에서 공부중인, 다양한 걸 배울려 하는, 항상 모자름을 느끼기에 성장하는 학생 :D

0개의 댓글