Created
August 3, 2020 08:08
-
-
Save Ayeeta/1164bfda11418498ba697e22d1319b49 to your computer and use it in GitHub Desktop.
About collections in Kotlin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
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