What is the difference between these statements
obj=null and obj.dispose()
Answer Posted / sanjeev
obj=null
when we use obj=null then this object has existence in
memory with no any value.
obj.dispose()
when we use obj.dispose() then the clr release the memory
and there are no any existence of that object into the
memory. so it will be better to use obj.dispose()
Note:- By default it is automatically disposed by the clr
when there are no any references in the left
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
What are the generation of Garbage Collection in C# .NET ?
List out two different types of errors in c#?
Can a dictionary have duplicate keys c#?
What is session management in c#?
What is the difference between list and arraylist in c#?
Why do we parse in c#?
What are the types of operator?
Can hashtable have duplicate keys in c#?
Why do we need static class in c#?
Is c# substring zero based?
What is the difference between ref and out parameters in c#?
How do I move from one form to another in c#?
What is iqueryable and ienumerable in c#?
What is a multi line comment?
What is iqueryable in c#?