Skip to content

Instantly share code, notes, and snippets.

Last active July 11, 2019 07:57
What would you like to do?
fun main(args: Array<String>) {
val mutableList: MutableList<Int> = mutableListOf(4, 5, 6)
val listNotToBeAmended: List<Int> = mutableList
println("listNotToBeAmended before add: $listNotToBeAmended")
println("listNotToBeAmended after add to underlying list: $listNotToBeAmended")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment