Assigning the null Value
null value assignment
null value to a variable of a reference type makes that variable stop referencing its current object.
the actual object becomes a candidate for finalization by the garbage collector. After all, not being referenced by any variable means that the object is not being used in the program at all.
Let’s look at an example where two variables are referencing the same object:
auto variable = new MyClass;
auto variable2 = variable;
The following is a representation of the state of the memory after executing that code: