How can we assign null values to object in c#?

Posted by Shreedar under C# on 8/29/2015 | Points: 10 | Views : 271 | Status : [Member] | Replies : 1
Hi

In one of my interview, I faced a question that how you will asign null value to an object?
Can any one give answer for the same?

Regards

Sridhar Thota.
www.dotnet-sridhar.blogspot.com



Responses

Posted by: Sheonarayan on: 8/29/2015 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
This question seems pretty easy if I understand correctly.
Like this

MyObject myObj = new Object();

myObj = null; // this should assign null value to an object.


Regards,
Sheo Narayan
http://www.dotnetfunda.com

Shreedar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response