What is immutable object in asp.net
What is immutable object in asp.net.with example
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Apr 1, 2013, 10:26 PM EDT
Deependra Khangarot199 reputationPosted Apr 1, 2013, 10:30 PM EDT
class Rectangle { private readonly long _length, _width; public Rectangle( long length, long width) { _length = length; _width = width; } public virtual long Length { get { return _length; } } public virtual long Width { get { return _width; } } } class Square : Rectangle { public Square( long width) : base( width, width) { } }You can follow below link for more information:
http://weblogs.asp.net/adilakhter/archive/2008/04/16/designing-efficient-immutable-net2-0-objects.aspx
Don't forget to mark useful responses as Answer if they helped you towards a solution.
VulpesRank #55 · 29.2K reputationPosted Apr 2, 2013, 3:04 AM EDT
Methods which appear to alter a string (Insert, Replace, Remove etc) do in fact produce a new string as neither the length nor content of the existing string can be changed.