rahul jaiswal
what is difference between destruct or and garbage collection ?
By rahul jaiswal in ASP.NET on Aug 25 2012
  • Pramod Verma
    Jan, 2015 24

    Garbage Collector : GC automatically call when our object no longer used. It is applicable for Managed Code only [.Net code only]Destructor : Destructor is Finalize. We use for releasing un-managed code.

    • 0
  • Pramod Verma
    Jan, 2015 24

    Garbage Collector : GC automatically call when our object no longer used. It is applicable for Managed Code only [.Net code only]Destructor : Destructor is Finalize. We use for releasing un-managed code.

    • 0
  • rahul jaiswal
    Aug, 2012 25

    1.The garbage collector is a part of the .NET environment that keeps track of objects and makes sure that objects are removed from memory when they are no longer needed.

    A destructor is a part of a class design. It's the opposite of a constructor. When you declare it the GC will call it when it destroys an object.

    2.The destruct or is a special member function which is invoked when an object is destroyed. It is the last method run by a class.

    The garbage collector is part of the framework, automatically manages memory, and non-deterministically collects unreferenced objects to avoid memory leaks.

    3.Both are used to destroy unallocated object in the memory.

    4. Destroy are called CLR (Common Language Run time) and Garbage Collection called by .net Framework.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS