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's the difference between a method and a procedure?

577


What is gridview c#?

570


What are annotations in c#?

606


Define thread? Explain about multithreading?

647


Why do we need constructors?

588






what is the meaning of Object lifetime in OOPS

609


How do I open the console?

683


Is unity object oriented?

575


What are the advantages of using partial classes?

612


What is a namespace server?

536


Are tuples mutable c#?

572


Are multiple data types stored in System.Array?

754


Describe how a .net application is compiled and executed

591


What is the lock statement in c#?

628


Why dependency injection is used in c#?

565