Last active
August 28, 2020 06:59
-
-
Save husen-hn/1923fcd531953458fb84fe10a2f79b1d to your computer and use it in GitHub Desktop.
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
fun main() { | |
val immutableList = listOf(1,2,3,4,5,6,7) //(1) | |
println("Immutable List $immutableList") | |
val mutableList = immutableList.toMutableList() //(2) | |
println("Mutable List $mutableList") | |
mutableList.add(8) //(3) | |
println("Mutable List after add $mutableList") | |
println("Mutable List after add $immutableList") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment