Kotlin Collection 공식 문서를 정리 한 글입니다. Collection의 plus / minus operator에 대해 알아봅니다.
Github repo 에서 아래에 적힌 Kotlin 코드들을 확인 하실 수 있습니다.
Plus / Minus operator
Plus / Minus
- Collection은
+/-기호도 지원 ( collection과 collection, collection과 동일한 type의 element 끼리 지원 )
1 | |
- augmented Assignment operator (
-=/+=)는 list 자체를 재정의하는 것과 같아var/ read only collection ( immuttable ) 타입에서만 지원
1 | |
출처 : https://kotlinlang.org/docs/collection-plus-minus.html
"Android" 카테고리의 최근 포스팅
카테고리 모든 글 보기| Kotlin - 코루틴 동작 원리 ( Continuation / CPS / State Machine ) | 2025. 04. 23 |
|---|---|
| JVM - Runtime Data Area - Thread | 2025. 04. 21 |
| JVM - Runtime Data Area - Heap | 2025. 04. 21 |
| JVM - Runtime Data Area - Method | 2025. 04. 19 |
| JVM - Interned string | 2025. 04. 18 |
| Android - 직렬화 | 2025. 04. 17 |
| Hilt - ComponentScope | 2025. 04. 16 |
| Kotlin - Channel | 2025. 04. 15 |
| Android - ViewModel 에 대해서 | 2025. 04. 14 |
| Android - Bundle 이란 | 2025. 04. 13 |