Base destructor : Destructor : Class C# Examples


C# Examples » Class » Destructor »

 

Base destructor









    
using  System;

public  class  Base
{
      ~Base()
      {
            Console.WriteLine(  "Base.~Base()"  );
      }
}

public  class  Derived  :  Base
{
      ~Derived()
      {
            Console.WriteLine(  "Derived.~Derived()"  );
      }
}

public  class  MainClass
{
      static  void  Main()
      {
            Derived  derived  =  new  Derived();
      }
}
    
   
  
   



Output

Derived.~Derived()
Base.~Base()


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Class
» Destructor