Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

meaning immutable and mutable

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

mutable vs immutable

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.
Comment

PREVIOUS NEXT
Code Example
Csharp :: mongodb c# batch find 
Csharp :: get the number of cpu c# 
Csharp :: c# example code 
Csharp :: run file windows forms 
Csharp :: dataannotations datetime range 
Csharp :: authentication and authorization in asp.net c# with example 
Csharp :: group by unique c# 
Csharp :: linked list reverse 
Csharp :: unity activate gameobject via script 
Csharp :: if statement 
Csharp :: c# draw rectangle on screen 
Csharp :: static class can have non static member in c# 
Csharp :: LINQ: 2 join with group by 
Csharp :: c# wpf row definition height * in code 
Csharp :: c# delete files 
Csharp :: unity check if current scene is being unloaded 
Csharp :: c# inheritance 
Csharp :: concatenation in c# 
Csharp :: enum in c# 
Csharp :: for jump script unity 2d 
Csharp :: How can I display image from database in asp.net mvc. I created image table and image path as varchar 
Csharp :: loop for x amount of seconds c# 
Csharp :: csharp bubble sort 
Csharp :: C# How to make a field read-only outside of class 
Csharp :: kendo validator tries to validate hidden fields 
Csharp :: dinktopdf page break 
Csharp :: c# json 
Csharp :: cache trong mvc 
Csharp :: c sharp system pause equivelent 
Csharp :: install nuget package for S3 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =