Meaning Immutable And Mutable

[Solved] Meaning Immutable And Mutable | Scala - Code Explorer | yomemimo.com
Question : meaning immutable and mutable

Answered by : arpan-guin

A mutable object can be changed after it's created, and an immutable object can't.

Source : | Last Update : Thu, 09 Sep 21

Question : mutable vs immutable

Answered by : zany-zebra-dgbw92d3j1yq

Mutable instance is passed by reference.
Immutable instance is passed by value.
Abstract example. Lets suppose that there exists a file named txtfile on my HDD. Now, when you are asking me to give you the txtfile file, I can do it in the following two modes:
I can create a shortcut to the txtfile and pass shortcut to you, or
I can do a full copy of the txtfile file and pass copied file to you.
In the first mode, the returned file represents a mutable file, because any change into the shortcut file will be reflected into the original one as well, and vice versa.
In the second mode, the returned file represents an immutable file, because any change into the copied file will not be reflected into the original one, and vice versa.

Source : https://stackoverflow.com/questions/214714/mutable-vs-immutable-objects | Last Update : Tue, 04 Oct 22

Answers related to meaning immutable and mutable

Code Explorer Popular Question For Scala