How to use automatically implemented property in C#

1 Answer

0 votes
using System;

namespace ConsoleApplication_C_Sharp
{
    class CClass
    {
        public int Value
        {
            get;
            set;
        }
    }
    class Program
    {
        static void Main()
        {
            CClass CClass = new CClass();

            CClass.Value = 123;

            Console.WriteLine(CClass.Value);
        }
    }
}


/*
run:
   
123
 
*/

 



answered Aug 22, 2018 by avibootz

Related questions

1 answer 112 views
112 views asked Dec 14, 2020 by avibootz
1 answer 165 views
165 views asked Aug 22, 2018 by avibootz
1 answer 177 views
2 answers 244 views
244 views asked Aug 22, 2018 by avibootz
...