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
Can you use foreach iteration on arrays in c#?
Explain get and set accessor properties?
Explain lock, monitors, and mutex object in threading.
Is Facebook a desktop application?
What is the difference between dispose() and finalize() methods in c#?
What is exe file in c#?
how to print invert pyramid in c#
What is dictionary collection in c#?
What is reflection in c#?
What is the concept of strong names?
What is an Interface in C#?
What is the main method?
How do I use the 'using' keyword with multiple objects?
How do I register my code for use by classic com clients?
What is jit (just in time)?