Mutable and Immutable classes

What is mean by mutable and immutable classes? Please give any examples.

Questions by khaderhk

Showing Answers 1 - 6 of 6 Answers

Mutable classes have the ability to be changed after instantiation. Immutable classes can not be modified after instantiation.

A good example of this is the String class in Java. Once a string is created, there are no functions available to modify the string. Instead, programmers rely on the assignment operator to assign a new string to the variable.

  Was this answer useful?  Yes

Rambhupal Reddy

  • Jun 13th, 2007
 

string is a immutable...stringbuilder is mutable..string builder can have namespace system.text....

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions