Click here to Skip to main content
15,895,192 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi everyone!Can anyone explain me mutable and imutable?
Posted

Basically I can say the basic different between Mutable and Immutable.

String is immutable
i.e. Strings cannot be altered. When you alter a string (by adding to it for example), you are actually creating a new string.

But StringBuilder is not immutable
so if u have to alter a string many times, such as mutliple concatenations then use StringBuilder.

Simply says,
Mutable is liable to change.
Immutable is not liable to change.


Please vote and Accept Answer if it Helped.
 
Share this answer
 
Comments
hemantwithu 28-Sep-10 5:16am    
Reason for my vote of 5
Automatic vote of 5 for accepting answer.
Hi,

Please visit following link

http://stackoverflow.com/questions/214714/mutable-vs-immutable-object[^]

Thanks,
Imdadhusen
 
Share this answer
 
Comments
hemantwithu 28-Sep-10 5:38am    
Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900