Spec-Zone.ru › Kotlin 2

isEmpty

kotlin-stdlib/kotlin.collections/LinkedHashMap/isEmpty

Начиная с Kotlin: 1.0

expect open override fun isEmpty(): Boolean

Возвращает true, если карта пуста (не содержит элементов), и false в противном случае.

Примеры

import kotlin.test.*
import java.util.*

fun main() { 
   //sampleStart 
   println("emptyMap<Int, Int>().isEmpty() is ${emptyMap<Int, Int>().isEmpty()}") // true
println("mapOf(1 to 2).isEmpty() is ${mapOf(1 to 2).isEmpty()}") // false 
   //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.collections/-linked-hash-map/is-empty.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API