Returns an empty new LinkedHashSet.
Since Kotlin
1.1Samples
import kotlin.test.*
fun main() {
val set: LinkedHashSet<Int> = linkedSetOf<Int>()
set.add(1)
set.add(3)
set.add(2)
println(set)
}
Target: JVMRunning on v.2.1.20
Returns a new LinkedHashSet with the given elements. Elements of the set are iterated in the order they were specified.
Since Kotlin
1.1Samples
import kotlin.test.*
fun main() {
val set: LinkedHashSet<Int> = linkedSetOf(1, 3, 2)
println(set)
set.remove(3)
set += listOf(5, 4)
println(set)
}
Target: JVMRunning on v.2.1.20
Returns an empty new LinkedHashSet.
Since Kotlin
1.1Samples
import kotlin.test.*
fun main() {
val set: LinkedHashSet<Int> = linkedSetOf<Int>()
set.add(1)
set.add(3)
set.add(2)
println(set)
}
Target: JVMRunning on v.2.1.20
Returns a new LinkedHashSet with the given elements. Elements of the set are iterated in the order they were specified.
Since Kotlin
1.0Samples
import kotlin.test.*
fun main() {
val set: LinkedHashSet<Int> = linkedSetOf(1, 3, 2)
println(set)
set.remove(3)
set += listOf(5, 4)
println(set)
}
Target: JVMRunning on v.2.1.20