A String is an immutable object which means when given a value, the old value doesn't get wiped out of memory, but remains in the old location, and the new value is put in a new location. So if the default value of String a
was String.Empty
, it would waste the String.Empty
block in memory when it was given its first value.
Although it seems minuscule, it could turn into a problem when initializing a large array of strings with default values of String.Empty
. Of course, you could always use the mutable StringBuilder
class if this was going to be a problem.