размер
Начиная с Kotlin: 2.1
expect val size: Int
Возвращает количество элементов в массиве.
Примеры
import kotlin.concurrent.atomics.*
import kotlin.concurrent.atomics.AtomicArray
import kotlin.test.assertFailsWith
fun main() {
//sampleStart
val a = AtomicLongArray(longArrayOf(1, 2, 3, 4, 5))
println(a.size) // 5
//sampleEnd
}
© 2010–2026 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.concurrent.atomics/-atomic-long-array/size.html