what is finalize() and dispose() methods?

what is the difference between these two?


4 Answers
1-4 of  4
4 Answers
  • those methods cal when the cursor comes to closing Brackets of Main method.
    By default the Garbage collector will call those methods when the programe is going to stop or 
    when the momery is less to maintain our appliucatation.

  • The main difference between dispose() and finalize() is that the method dispose() has to be explicitly invoked by the user whereas, the method finalize() is invoked by the garbage collector, just before the object is destroyed.

  • + Purpose of both the method is same that is "Removing object from memory which is not in use from long time and occupying the space unnecessarly" + Where the Finalize() is called implicitly by Garbage collector and Dispose() is called explicitly by Devloper

C Sharp Dot Net

Didn't get the answer.
Contact people of Talent-C Sharp Dot Net directly by clicking here