• Top Posts

    What is a Destructor in C#?


    •  Destructor is used to clean up the memory and free the resources. But in C# this is done by the garbage collector on its own. System.GC.Collect() is called internally for cleaning up. But sometimes it may be necessary to implement destructors manually.
    Ex :

    ~Car()
    {
    Console.writeline(“….”);
    }

    No comments

    Post Top Ad

    ad728

    Post Bottom Ad

    ad728