empty List
Returns an empty read-only list. The returned list is serializable (JVM).
Samples
import samples.*
import kotlin.test.*
fun main() {
//sampleStart
val list = listOf<String>()
assertTrue(list.isEmpty())
// another way to create an empty list,
// type parameter is inferred from the expected type
val other: List<Int> = emptyList()
assertTrue(list == other, "Empty lists are equal")
assertPrints(list, "[]")
assertFails { list[0] }
//sampleEnd
}