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
Is datetime a value type in c#?
What is the difference between asp net and c#?
What is entity framework in c#?
What are the different approaches of passing parameters to a method?
What is global namespace in c#?
What is the difference between a method and a property?
What are value types in c#?
What Is The Difference Between The System.array.copyto() And System.array.clone()?
Explain how is the dll hell problem solved in .net?
Define delegation in .net?
In languages without exception-handling facilities, we could send an error-handling procedure as a parameter to each procedure that can detect errors that must be handled. What disadvantages are there to this method?
Explain the difference between “system.array.clone()” and “system.array.copyto()” in c#?
Why static constructor is parameterless in c#?
What is Implementation inheritance
Explain briefly the difference between value type and reference type?