Basics
Literals
Variables
// list creation
val myMutableList = mutableListOf(1, 2, 3, 4, 5)
// trying to update the list
myMutableList = mutableListOf(1, 2, 3, 4, 5, 6) // error line
// adding a new element
myMutableList.add(6) // it works
// printing the list
println(myMutableList) // [1, 2, 3, 4, 5, 6]Data types
Functions
Last updated