
Originally Posted by
vcdebugger
may be the keyword "sealed" which dont allow you to inherit the string class further ?
No, it is immutable simply because the class gives you no way to change its member data. Look at this class:
Code:
class Foo
{
public readonly int Id;
public readonly string Name;
public Foo( int id, string name )
{
Id = id;
Name = name;
}
}
That class is immutable. You pass some data into the constructor, the data is set, and now there is no way that it can be changed by the outside world.