Created
April 2, 2018 09:18
-
-
Save sajjadyousefnia/cee101469326b81d5e22d1992808f8bb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// a mutable list of a certain type e.g. String | |
val mutableListNames: MutableList<String> = mutableListOf<String>("Josh", "Kene", "Sanya") | |
mutableListNames.add("Mary") | |
mutableListNames.removeAt(1) | |
mutableListNames[0] = "Oluchi" // replaces the element in index 0 with "Oluchi" | |
// a mutable list of mixed types | |
val mutableListMixed = mutableListOf("BMW", "Toyota", 1, 6.76, 'v') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment