Skip to content

Instantly share code, notes, and snippets.

@Ayeeta
Created August 3, 2020 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ayeeta/1164bfda11418498ba697e22d1319b49 to your computer and use it in GitHub Desktop.
Save Ayeeta/1164bfda11418498ba697e22d1319b49 to your computer and use it in GitHub Desktop.
About collections in Kotlin
/**
Immutable lists/arrays uses the listOf() method
together with a few methods for operations on lists/arrays
**/
val alphabets = listOf("c","d","b","a")
println(alphabets)
println(alphabets.sorted())
println(alphabets[2])
println(alphabets.contains("b"))
println(alphabets.last())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment