What is the difference between these statements
obj=null and obj.dispose()

Answer Posted / pushparaj pentakota

obj=null is remove the reference to object only but that
object will be existed but obj.dispose() is clear the
reference and as well as clear the object also from the
memory.so obj.dispose() is best to use but in some cases not.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does void mean in c#?

748


What are circular references? How garbage collection deals with circular references.

743


Which is more efficient for loop or while loop?

672


What's the implicit name of the parameter that gets passed into the set method/property of a class?

814


How to put assembly in gac?

733


What is difference between asp net and c# net?

708


Define a partial class?

691


What is a service layer c#?

665


What is a interface in c#?

688


Explain the ways to deploy an assembly?

749


What is uint64?

740


Can non-default constructors be used with single call sao?

774


What is default access specifier for class in c#?

713


What are custom attributes in c#?

690


Can a static class contain non static members?

781