Language/Kotlin
Kotlin - Arrays (배열)
TechNote.kr
2018. 7. 11. 00:09
728x90
배열은 get, set function과 size property를 가진 Array class로 표현된다.
class Arrayprivate constructor() { val size: Int operator fun get(index: Int): T operator fun set(index: Int, value: T): Unit operator fun iterator(): Iterator // ... }
배열을 만들기 위해서는 다양한 방법이 있다.
arrayOf()
arrayOfNulls()
Array constructor
[] operation
Java와는 다르게 Kotlin은 Array의 값이 한번 정해지면 변하지 않는다.
728x90