empty
Thanks for your feedback!
Was this page helpful?
Returns an empty read-only map of specified type.
The returned map is serializable (JVM).
import kotlin.test.* import java.util.* fun main() { //sampleStart val map = emptyMap<String, Int>() println("map.isEmpty() is ${map.isEmpty()}") // true val anotherMap = mapOf<String, Int>() // "Empty maps are equal" println("map == anotherMap is ${map == anotherMap}") // true //sampleEnd }
xxxxxxxxxx
val map = emptyMap<String, Int>()
println("map.isEmpty() is ${map.isEmpty()}") // true
val anotherMap = mapOf<String, Int>()
// "Empty maps are equal"
println("map == anotherMap is ${map == anotherMap}") // true
Thanks for your feedback!