Tuesday, 1 May 2018

Simple console application using Get and Set Properties


Simple console application using Get and Set Properties
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplicationSample
{
    class GetSet
    {
        private int number;
        public int Anumber
        {
            get { return number;}
            set { number = value; }
        }
    }
    class PropertyMethod
    {
        public static void Main()
        {
            GetSet n = new GetSet();
            n.Anumber=12;
            int m = n.Anumber;
            Console.Write("Number = {0}", +m);
            Console.ReadKey();
        }
    }
}
https://www.youtube.com/channel/UCKLRUr6U5OFeu7FLOpQ-FSw/videos

0 comments

Post a Comment