Created
August 20, 2020 14:16
-
-
Save husen-hn/9946fa42c96185eb9df17b0316de3ae4 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
class MutableObj { | |
var value = "" | |
override fun toString(): String { | |
return "MutableObj(value='$value')" | |
} | |
} | |
fun main() { | |
val mutableObj:MutableObj = MutableObj()//(1) | |
println("MutableObj $mutableObj") | |
mutableObj.value = "Changed"//(2) | |
println("MutableObj $mutableObj") | |
val list = mutableListOf("a","b","c","d","e")//(3) | |
println(list) | |
list.add("f")//(4) | |
println(list) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment