G
Guest
I come form a C++ background and am new to C#. I am puzzled by the object
instantiation mechanism, and would be grateful if someone could clarify the
following related questions:
- If I declare a property as a user-defined object (ie as a reference) how
can I test to see if it has been instantiated (assigned) or not?
- If I use 'new' to instantiate an object, but the reference variable I use
already refers to an instantiation of the class, is the reference variable
reassigned, and if so what happens to the object it previously referenced
(which is now presumably completely inaccessible)?
instantiation mechanism, and would be grateful if someone could clarify the
following related questions:
- If I declare a property as a user-defined object (ie as a reference) how
can I test to see if it has been instantiated (assigned) or not?
- If I use 'new' to instantiate an object, but the reference variable I use
already refers to an instantiation of the class, is the reference variable
reassigned, and if so what happens to the object it previously referenced
(which is now presumably completely inaccessible)?