Beispiel #1
0
        //Copy Constructor

        public Constructorexample(Constructorexample constructorexample)
        {
            Color  = constructorexample.Color;
            Height = constructorexample.Height;
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Product p  = new Product();
            Person  pe = new Person();

            p.Barcode     = "100091";
            p.Categories  = "Computer";
            p.ProductName = "Asus ROG String";

            pe.FristName = "Shah Neoaj Kabir";
            pe.LastName  = "Bappy";
            p.GetName();
            pe.GetName();
            Console.WriteLine("The Product Name Is : {0}", p.GetName());
            Console.WriteLine("The Person Name Is : {0}", pe.GetName());

            Console.WriteLine("Hello World!");
            Electronics ee = new Electronics();


            //We Can Use All product item for electronics because of inherit
            ee.ProductName = "Wear";
            ee.Categories  = "Electronic";
            ee.Barcode     = "101123";
            Console.WriteLine("The Electric product is {0} ", ee.GetName());
            //Property Call;
            ee.Accesories = "Bappy";
            ee.Autoprop   = "Auto Property";
            Console.WriteLine("The Electric Accesories is {0} ", ee.acce());
            Console.WriteLine("The Auto Property Accesories is {0} ", ee.FullDemo);

            //Constructor
            Constructorexample constructorexample  = new Constructorexample("Red", 5.5);
            Constructorexample constructorexample2 = new Constructorexample("Blue", 6.5);
            Constructorexample constructorexample3 = new Constructorexample(7.5);
            //Copy Constructor Call
            Constructorexample constructorexample4 = new Constructorexample(constructorexample);

            //Finalizer Class
            //Property Use Print
            FinalizerExample finalizer = new FinalizerExample();

            Console.WriteLine("Enter Your First Name");
            finalizer.Name = Console.ReadLine();
            Console.WriteLine("Enter Your Last Name");

            finalizer.lastName = Console.ReadLine();
            Console.WriteLine("My Name Is : {0}", finalizer.FullName);

            //Bottle Class

            Bottle bottle = new Bottle();

            bottle.color = "Red";
            bottle.size  = "ASDF";
            Console.WriteLine(bottle.Total);


            //Abstract Class declared
            AbstractClassExample example = new AbstractClassChildExample();
            //or
            AbstractClassChildExample childExample = new AbstractClassChildExample();

            example.abstractmethod("", "", "");
            childExample.abstractmethod("", "", "");

            Console.ReadKey();
        }