Wednesday 27 July 2016

C Sharp Properties Tutorial

C# Properties Program

 class test
    {
        int x;
        public int setX
        {
            get
            {
                return x;
            }
            set
            {

                x = value;
            }
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            test ob = new test();
            ob.setX = 222;
            Console.WriteLine(ob.setX);
        }
    }


Next Topic

No comments:

Post a Comment