# Collections

```kotlin
val list = listOf(1, 2, 3)
val mutableListOf = mutableListOf(1, 2, 3)

val set = setOf(1, 2, 3)
val mutableSet = mutableSetOf(1, 2, 3)

val map = mapOf(1 to "1", 2 to "2", 3 to "3")
val mutableMap = mutableMapOf(1 to "1", 2 to "2", 3 to "3")
```

* Kotlin 은 Java 와 다르게 mutable, immutable 2가지의 collection 이 존재한다.
* mutable 은 변경 가능한 collection 을 말한다.
* immutable 은 변경 불가능한 collection 을 말한다.
* mutable prefix 가 없는 자료구조는 기본적으로 immutable 이다.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gold.gitbook.io/kotlin/collections/collections-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
