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 is stringwriter c#?
What does return do in for loop?
What is assembly and dll in c#?
What is the difference between hashtable and dictionary in c#?
What is type class in c#?
Can you instantiate an abstract class c#?
What is the purpose of namespace in c#?
What is trim in c#?
What is boolean conditions in c#?
Why generics are used in c#?
Is there regular expression (regex) support available to c# developers?
Explain the difference between .net and c#?
Is c# code is managed or unmanaged code?
What is array formula?
Explain constructor in c#?