CrazyEngineers
  • Difference B/w Finalize and Finally in .Net?

    babloo0311

    Member

    Updated: Oct 26, 2024
    Views: 1.3K
    Hi Everyone,


    I want the Difference between finalize method and Finally method in .NET and when exactly the garbage collector calls these methods. What does Dispose method does.
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • arunhero99

    MemberJan 13, 2009

    <a href="https://allu.wordpress.com/2006/11/08/difference-between-final-finally-and-finalize/" target="_blank" rel="nofollow noopener noreferrer">Difference between final, finally and finalize() | ALLU</a>
    Are you sure? This action cannot be undone.
    Cancel
  • rashmi05

    MemberJan 14, 2009

    The Dispose pattern is used to release unmanaged resources in a timely fashion. This allows you to do this in a way that you have control over when they are released. where as Finalize method is also used for the purpose of releasing resources - but in this You have no control over when it will be called by the GC. Further,
    implementing a Finalize method can have an adverse affect on the performance of the GC because it takes two passes of the GC to collect objects that override Finalize.
    Are you sure? This action cannot be undone.
    Cancel
  • babloo0311

    MemberJan 14, 2009

    thanks friends
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register