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

Difference between a sub and a function in c#.

747


If the original method is not static you can declare an override method to be static or not?

705


What are handlers in c#?

725


How can you prevent escaping on backslashes in C# with string definitions?

944


Tell me the difference between call by value and call by reference.

745


What are the advantages of using c#?

717


What is the base class of all classes in c#?

739


Why is .net so popular?

704


What is generic collection in c#?

685


What is a static field?

695


What is namespace in oops?

672


What is meaning of type safety in c#?

653


What is managed or unmanaged code?

858


Are structs value types or reference types?

770


What is the difference between mobile application and desktop application?

667