emptyMap

fun <K, V> emptyMap(): Map<K, V>

Returns an empty read-only map of specified type.

The returned map is serializable (JVM).

Samples

import samples.*
import kotlin.test.*
import java.util.*
fun main() { 
   //sampleStart 
   val map = emptyMap<String, Int>()
assertTrue(map.isEmpty())

val anotherMap = mapOf<String, Int>()
assertTrue(map == anotherMap, "Empty maps are equal") 
   //sampleEnd
}