If I have this:
string str = "string";
can we say that on the heap is created an object of type string
that contains "string"
?
or
does the CLR, thanks to interning, creates that literal into an intern
pool that's referenced inside str
object?
so, basically, is this, figuratively, correct:
str --> [ methods, fields, ..., "string"]
or is this correct?
str --> [ methods, fields, ..., ---> "string"]
where [ ]
represents the object.