Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
fun main(args: Array<String>) {
val items = listOf(1, 2, 3, 4)
println("First Element of our list----"+items.first())
println("First Element of our list----"+items.last())
println("Even Numbers of our List----"+items.filter { it % 2 == 0 }) // returns [2, 4]
val readWriteMap = hashMapOf("foo" to 1, "bar" to 2)
println(readWriteMap["foo"]) // prints "1"
val strings = hashSetOf("a", "b", "c", "c")
println("My Set Values are"+strings)
}
Advertisements
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.
AcceptLearn more