setOf

fun <T> setOf(vararg elements: T): Set<T>(source)

Returns a new read-only set with the given elements. Elements of the set are iterated in the order they were specified. The returned set is serializable (JVM).

Since Kotlin

1.0

Samples


inline fun <T> setOf(): Set<T>(source)

Returns an empty read-only set. The returned set is serializable (JVM).

Since Kotlin

1.0

Samples


expect fun <T> setOf(element: T): Set<T>(source)

Returns a new read-only set containing only the specified object element.

The returned set is serializable (JVM).

Since Kotlin

1.9

Samples

actual fun <T> setOf(element: T): Set<T>(source)

Returns a new read-only set containing only the specified object element.

Since Kotlin

1.1

Samples

actual fun <T> setOf(element: T): Set<T>(source)

Returns a new read-only set containing only the specified object element.

The returned set is serializable.

Since Kotlin

1.0

Samples

actual fun <T> setOf(element: T): Set<T>(source)

Returns a new read-only set containing only the specified object element.

Since Kotlin

1.3

Samples

actual fun <T> setOf(element: T): Set<T>(source)

Returns a new read-only set containing only the specified object element.

Since Kotlin

1.8

Samples

actual fun <T> setOf(element: T): Set<T>(source)

Returns a new read-only set containing only the specified object element.

Since Kotlin

1.8

Samples