Lalit Raghav
What is virtual destructor in C#?
By Lalit Raghav in .NET on Oct 21 2016
  • tuhsar sale
    Sep, 2018 9

    I hope you know the reasons why C++ has "virtual destructors". It is all about having to manually destroy objects and about pointer types in your C++ code and the problems that spring from it. In C#/.NET you do not manually destroy objects (the garbage collector of the runtime takes care of that, and it also takes care to call the destructors in a inheritance chain in the right order). That means, the very reasons that made virtual destructors necessary in C++ do not exist in .NET -- hence no virtual destructors in .NET

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS