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
Why do we use struct in c#?
Can constructor have return type c#?
What is binding in c#?
What is the components of window?
Why singleton class is sealed?
What is .cs file in c#?
What is generic collection in c#?
Explain the difference between “as” and “is” operators used in c#?
What is inumerable?
Can struct have constructor c#?
What is the difference between method and function in c#?
What are the advantages of using delegates in c#?
How to find Percentage, name ,College from a resume or document ? How to export these values to other page in C#?
What is the console on a mac?
What is meant by collections in c#?