Class, Constructor

 using System;

using System.Collections.Generic;

using System.Text;


namespace ConsoleApp2

{

     class Demo

    {


        public Demo()

        {

            Console.WriteLine("Constructor");

            Sum();

        }


        public Demo(String name)

        {

            Console.WriteLine("Name=" + name);

        }

        

        //Destructor De Alocate memory 

        ~Demo()

        {

            Console.WriteLine("Destructor");

        }


        public int number = 10;


       public void Sum()

       {

            Console.WriteLine("Sum=" + (number + number));

        }

    }

}


Comments

Popular posts from this blog

Method Function

Record