Why are reference types not destroyed immediately like value types? -
many tutorials reference types created on heap , can destroyed when last reference disappears. on contrary, value types created on stack , destroyed automatically right after go out of scope. information can found in many literature.
but couldn't figure out reason why reference types not destroyed such in value type case.
many tutorials reference types ... can destroyed when last reference disappears.
how else know when reference type has gone out of scope?
Comments
Post a Comment