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 Types of assemblies that can be created in dotnet
What are winforms in c#?
What is difference between an reference type and value type in C#?
Can firstordefault return null?
What are the Types of assemblies that can be created in dotnet
What is before string in c#?
What does get set mean in c#?
What are the 3 different types of arrays?
Explain how to use an extender provider in the project.
What is string method in c#?
What are partial classes and use of partial classes?
Explain the types of assemblies in .net?
What is string class in c#?
What is difference between private and static constructor?
What is ulong in c#?